I've just switched from Windows/Linux to a Macbook Pro, and am having trouble with sleep/screen off. My work involves running very long (multiple day) processes in R, so I need to be able to leave things running for a long time with the screen off, so as not to waste energy. At the moment it seems that if the screen goes to sleep, all processes are paused. Is there a way to get the linux/windows behaviour where the screen can time out but everything keeps running?

(Other similar questions I've found all refer to previous versions of MacOS and/or desktop versions, the system preferences seem to be completely different.)

  • I can’t answer the question, but I do know that when my screen is dark, it does not stop Time Machine backups.
    – WGroleau
    Commented Dec 11, 2020 at 21:51
  • 1
    You might need to explain what R is for an answer to be possible. As @WGroleau said of Time Machine backups, almost all active process continue when your Mac goes to sleep.
    – Pedro
    Commented Dec 12, 2020 at 4:52
  • R is a statistical programming environment - r-project.org - so what i'm actually doing is running long statistical analyses.
    – tzirtzi
    Commented Dec 12, 2020 at 8:37

2 Answers 2


The fastest way to always stop sleep is the built-in Terminal command caffeinate which will let you set various options on preventing sleep.

Another way is to disable sleep when plugged into battery under Settings, which is likely the easiest method as it has a visual indicator by way of the charger.

The Amphetamine app is yet another method, and it has a friendlier UI compared to Terminal as well as extra options.

By default all apps sleep when the display is off unless the app specifically requests otherwise.

  • thank you! this looks like it will solve it. i was just expecting something in settings!
    – tzirtzi
    Commented Dec 13, 2020 at 19:20
  • Amphetamine lets you stop sleep for a given app (like R) if you use the extra Enhancer app. macOS only seems to offer Windows-like sleep controls for desktops.
    – Dirk
    Commented Dec 14, 2020 at 2:46

For Big Sur, go to System Preferences > Battery and select setting for Power Adaptor. Click the checkbox for "Prevent computer from sleeping automatically when the display is off".

You must log in to answer this question.

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