Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to prevent a MacBook (the system, not the screen) from going to sleep?

I want the screen to go to sleep (which I realise is set in System Preferences -> Energy Saver) but I want the rest of the system to stay active, so that background processes I have running will continue. I can't seem to find how to set when the system goes sleep.

MacBook Pro with Retina display, OS X Mavericks (10.9)

Posted on Nov 14, 2013 5:01 AM

Reply
38 replies

May 12, 2014 7:16 PM in response to humjack

Unfortunately I had to disable these settings, as I noticed my Macbook Air remains in some form of "partial awake" state while the lid is closed, made evident by the fact that my battery level is reduced every time I reopen the lid.


It is important for me the laptop sleeps completely when closed, so alas I have not yet found a complete solution to this problem.

May 25, 2014 5:00 PM in response to humjack

I was really looking forward to that being a proper solution.


Apple seems to have no idea that people use their brand new MacBook Pro laptops for network troubleshooting (or other critical mobile work), which I primarily do on-site and ALWAYS without plugging my stupid laptop in every time I move 15 feet.


With multiple laptops, I leave one pinging or gathering packets, and I use the other for the troubleshooting. Each time I leave one for a few minutes, it stops doing its job. It's absolutely ridiculous that they have assumed our use for their product and conveniently crippled their functionality.


And if they think I would be better off with a Dell, well then they should bite me. Oh wait, they already are!


Bummed out on this one.

~Laz

Dec 27, 2014 2:13 AM in response to Duk242

Hi Ducky,


I've applied your recommended settings, however now it seems that my MacBook doesn't go to sleep even when the lid is closed. I've tried the following:


1. Open Terminal

2. Type: sudo pmset -b sleep 1

3. Type: sudo pmset -b standby 1


But got the following message:


Warning: Idle sleep timings for "Battery Power" may not behave as expected.

- Display sleep should have a lower timeout than system sleep.

- Disk sleep should be non-zero whenever system sleep is non-zero.


Can you please suggest how to reset the setting to the original? OR a way when lid is closed macbook goes to sleep?


Thanks,

Greg

Dec 20, 2016 7:12 AM in response to nachiketkk

Running

caffeinate
is a great solution for my use case (need to keep the system up so that it can complete running a network backup utility) since unlike the pmset commands, it is fully reversible (all effects are undone when you Ctrl-C or close the terminal window and the
caffeinate
program exits, and it can even be run with a timeout of its own (output from man caffeinate, edited for clarity):


SYNOPSIS

caffeinate [-dimsu] [-t timeout] [-w pid] [utility arguments...]


Available options:

-d Prevent the display from sleeping.

-i Prevent the system from idle sleeping.

-m Prevent the disk from idle sleeping.

-s Prevent the system from sleeping. This ... is valid only when system is running on AC power.

-u Declare that user is active. If the display is off, this option turns the display on and prevents the

display from going into idle sleep. If a timeout is not specified with '-t' option,

then this [uses] a default of 5 second timeout.


-t Specifies the timeout value in seconds ... Timeout value is not used when a utility is invoked

with this command.


-w Waits for the process with the specified pid to exit. caffeinate exits when the process does.

This option is ignored when a utility command argument is given.


EXAMPLE

caffeinate -i make

caffeinate runs make and prevents idle sleep as long as that process is running.

How to prevent a MacBook (the system, not the screen) from going to sleep?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.