This question already has an answer here:

I used to use InsomniaX but it doesn't work for me right now.

I want to stop my MacBook from sleeping when I close the lid.

marked as duplicate by Community Jul 5 at 13:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Use the latest version of KeepingYouAwake. It works pretty well in macOS Mojave. It's a GUI based wrapper around Apple's caffeniate command line utility. All current versions of macOS ship with caffeniate tool built-in. So, it should be safe to use.

Courtesy: https://github.com/newmarcel/KeepingYouAwake/#how-does-it-work

For installation:

  • You can download latest version from here, or

  • Install it using Homebrew by running: brew cask install keepingyouawake

Reference: https://github.com/newmarcel/KeepingYouAwake/#installation

  • KeepingYouAwake is great app to prevent your Mac from sleeping. However, it doesn't prevent sleep while the lid of a MacBook is closed. – Nimesh Neema Jul 5 at 7:35

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