Unofficial archive. This is a read-only, community-run archive of the Apple Support Community. It is not affiliated with or endorsed by Apple Inc.

M1 MacBook Pro sleeps when plugged in with display off despite settings

This is an odd one - I have all my power settings set to 'prevent automatic sleeping on power adapter when the display is off' and Low Power mode only on battery, but a couple of times since the upgrade to 27.0, my M1 MacBook Pro has effectively gone to sleep when plugged in and left alone so the display shuts off.

Are there any other settings I need to toggle to prevent this happening? It is annoying if the MacBook is running something that doesn't require interactive input so can be left with the display off and plugged in while it's running.

The battery is showing 'Normal' health, and charging settings are set to 100% charge and Optimize Battery Charging, but I don't think it's to do with the battery.

5 replies

Even if you have the "Prevent automatic sleeping on power adapter when the display is off" setting turned on, macOS can sometimes override this behavior due to overlapping configuration rules, a corrupted power plist file, or the laptop being physically closed.


Are you closing the MacBook lid? (Clamshell Mode)

If you are closing the laptop lid while your task runs, the M1 MacBook will always force itself to sleep to save power and prevent overheating. The only exception is if it is fully in "Clamshell Mode," which requires three things simultaneously: 

  • The power adapter is plugged in.
  • An external monitor is connected and active.
  • An external keyboard and mouse/trackpad are connected.


If you close the lid without an external monitor attached, it ignores your "prevent sleep" settings entirely and goes to sleep. To leave it running with the screen off, you must leave the lid open and let the display turn off via its normal inactivity timeout.


Force the background task to stay awake using caffeinate

If your background script or application doesn’t explicitly declare a "Power Assertion" (a signal to macOS saying "I am doing heavy lifting, don't sleep"), the OS might mistakenly flag the system as idle.

The most foolproof way to handle this for non-interactive tasks is via the Terminal:

  • Open the Terminal app.
  • Type caffeinate and hit return.

As long as that Terminal window is open, your Mac will not sleep. When your task is finished, go back to the Terminal and press Control + C to allow the Mac to sleep normally again. 


Clear corrupted power management files

If the lid is open and it’s still sleeping, your power configuration cache file may have become corrupted during your upgrade. You can force macOS to rebuild it:

  • Open Terminal.
  • Run the following command (it will ask for your Mac's login password, nothing will show on the screen as you type it):
sudo rm /Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist
  • Restart your Mac.
  • Go back to System Settings > Battery > Options and toggle the "Prevent automatic sleeping..." option off and back on to rewrite a clean file. 


Double-check the Lock Screen timing

Sometimes a mismatch between your display sleep and lock screen security forces a hard sleep. Go to System Settings > Lock Screen. Ensure that "Turn display off on power adapter when inactive" is set to a reasonable time (e.g., 10 or 15 minutes) rather than "Never," as letting the display turn off natively is what triggers your core "Prevent automatic sleeping" rules to correctly keep the background CPU alive.


One more point – is your Mac going to sleep, or are you being logged out? If the latter, there is a 'hidden' setting that causes that (not hidden per se, just somewhere most people don't think to look).


Go to System Settings > Privacy & Security > Advanced (button at the bottom) and toggle OFF the setting to Log out automatically after inactivity.



More information from Apple: Set your Mac to log out when not in use - Apple Support


Does "caffeinate" in Terminal work?

I’m not sure how to help you solve the root of the issue, but until you get it fixed, you can try opening the Terminal app and typing “caffeinate” (without the quotation marks), then press the return key. This should prevent it from sleeping until you close the terminal window.

I have run caffeinate overnight, with a simple 'ping' command running which wasn't terminated, so that looks like a temporary fix for now.


Still looking to see if there's some other setting that will stop this happening so I don't have to run caffeinate

Thank you for those suggestions, and I have checked them all, so it looks like none of these.


I don't have a com.apple.PowerManagement.plist file, so I can't remove it to rebuild.

I've checked the Auto logout after inactivity (and it's not set).

I'm not closing the lid, and my Lock Screen setting turns display off after 10 minutes.


When I've noticed the MacBook doing this, I have a process running in Terminal, which doesn't show any interruption when unlocking, so I'm not being logged out.