
Now, Click on the Amphetamine app icon from the top menu bar and then click on End Current Session. Click on two half-circle icon (that looks like a pill) from the top menu bar. You can read and click Next on all subsequent screens to learn more about this app. The above commands run as long as you leave the Terminal app running. Now your Mac will stay awake for this time duration caffeinate -t 1800 & Here 1800 is the time in seconds. To stop this, use the keyboard shortcut Ctrl+C caffeinate Now, your Mac will stay awake for as long as you leave the Terminal running.
caffeinate -s Keep the Mac awake while it is plugged into AC power.caffeinate -m To prevent the disk from going idle.
caffeinate -i To prevent the system from idle sleeping.caffeinate -d To prevent the display from sleeping.Type one of the following Terminal commands according to your preference and hit the enter.Or press Command (⌘) + Space Bar to open Spotlight Search and type Terminal. Go to Applications folder → Utilities → and open Terminal.Prevent Mac From Sleeping Using Terminal App RELATED: How to Keep MacBook from Sleeping With Lid Closed Now, you Mac will sleep after the set period of inactivity. If you wish to turn off this feature, follow the above steps, and drag the slider to the left and set the time according to your preference.
Next, tick the box for Prevent computer from sleeping automatically when the display is off. Drag the Turn display off after slider to Never → Select Ok from the popup. You can follow steps 3 and 4 below for both Battery power and while your MacBook is charging. Note: If you are on a MacBook, you will see two tabs here: Battery and Power Adapter. Click on the Apple logo from top-right → Click on System Preferences. Prevent Your Mac from Sleeping Using Energy Saver Prevent Mac From Sleeping Using Terminal App. Prevent Your Mac from Sleeping Using Energy Saver. So, let us dig right in and see how to stop your Mac from sleeping.
All of these methods are straightforward. The first one is using the energy-saver feature, second is to use the terminal, and the third is using a third-party app. Does your Mac go to sleep when you are downloading a file or backing it up? Do you want to keep your Mac from sleeping? Okay, there are three easy ways to do so.