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?


5 Answers 5


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


if you want to endlessly keep the system awake.

To end this mode press control c or kill the terminal

  • 1
    I didn't know that binary, dope 👌
    – anni
    Commented Oct 31, 2018 at 17:42
  • Awesome so we can put something like 5 years? 157680000 :-D Commented Apr 25, 2020 at 9:12

Anti Sleep is a free app available on the App Store. It prevents Mac from going into sleep mode.

  • +1 for Anti Sleep. Recently updated and good ratings on the App Store.
    – Nimesh Neema
    Commented Apr 11, 2018 at 11:00

NoSleep is a MacOS X kernel extension, preventing sleep when you close the lid.


KeepingYouAwake is a small menu bar utility for macOS (Version 10.10 and newer) that can prevent your Mac from entering sleep mode for a predefined duration or as long as it is activated.

It can be easily installed using Homebrew cask by running:

brew cask install keepingyouawake

It is an alternative to widely popular tool Caffeine from Lighthead Software. Caffeine hasn't been updated in a while. KeepingYouAwake's icons are Retina-compatible and do look nice in the dark themed menu bar.


You can try the freeware app Caffeine.

I use it to make sure presentations don't go poof in front of the suits who approve my budgets.

  • 5
    You can also use the built-in command caffeinate
    – JMY1000
    Commented Nov 27, 2017 at 3:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .