MacBook – Prevent MacBook Pro 2016 from sleeping (High Sierra)

energyhigh sierramacbook prosleep-wake

I need to prevent my 13" 2016 MacBook Pro from sleeping. I'm using the Sonnet Echo Express III-D and when the Mac sleeps, all cards in the devices are disconnected and won't come back until the Mac is restarted or Thunderbolt 3 cable is removed and reconnected. I have a case open with Sonnet, but until then, I don't want my Mac to sleep.

The Mac is running High Sierra and there appears to be no setting in Energy Saver that keeps the Mac from going to sleep while on the Power Adapter, other than this:

enter image description here

In earlier versions of macOS, there used to be a second slider that allowed you to set when the Mac sleeps, in addition to controlling the display.

Now, no matter what, my Mac will sleep whenever it wants, with no apparent way of controlling this.

I have tried Amphetamine but it appears the way this works is, when the computer tries to go to sleep, it interrupts it and keeps it awake. This won't work for me, since that's long enough for the cards in the Sonnet to all get disconnected.

How can I prevent my Mac from sleeping?

Best Answer

Use this on the terminal :

caffeinate -u -t <time_awake_in_secs>

It will keep the screen awake, avoid any restart till the time specified.

Use only

caffeinate

if you want to endlessly keep the system awake.

To end this mode press control c or kill the terminal