Mac won't sleep? How to find what's keeping it awake
One Terminal command shows exactly which app is stopping your Mac from sleeping. Here's how to read it and fix the usual culprits.
If your Mac’s screen stays on, or it never seems to sleep overnight, something is asking it to stay awake. Apps do this on purpose with a “power assertion”: a video player while a film plays, a backup while it runs, a download app. When one gets stuck, your Mac stays up all night.
1. Ask macOS who is holding it awake
Open Terminal and run:
pmset -g assertions
Look at the lines under Listed by owning process. Each one names an app and the kind of assertion, for example:
PreventUserIdleDisplaySleep: keeping the screen on (video players, presentation apps, browsers playing media)PreventUserIdleSystemSleep: keeping the Mac awake with the screen off (downloads, backups, builds)
The process name tells you which app to look at.
2. Fix the usual culprits
- A browser tab playing audio or video. Even a paused YouTube tab can hold it. Close the tab.
- Music or Spotify. Pause it, don’t just close the window.
- Backups and sync. Time Machine, Dropbox, Google Drive or iCloud finishing an upload. Let it finish once.
- Remote and sharing tools. Screen sharing, Remote Login or AirPlay receivers can keep the Mac reachable. Check System Settings > General > Sharing.
- Bluetooth devices. A mouse or keyboard that sends tiny movements can wake the screen.
3. Check your settings
On a MacBook, open System Settings > Battery > Options and look at Prevent automatic sleeping on power adapter when the display is off and Wake for network access. On a desktop Mac the same switches are under Energy.
4. Find out what woke it up
If your Mac sleeps but keeps waking, this shows the reasons:
pmset -g log | grep -i "wake reason"
The opposite problem
Sometimes you want your Mac to stay awake on purpose, for a long download or a render. Then use caffeinate in Terminal, or Vigil (ours), which keeps it awake for a set time or until an app quits, with a countdown in the menu bar. It uses the same kind of assertion, and it goes away the moment the timer ends.
More: keep your Mac awake and the caffeinate command.
Vigil, live in your browser
This is the real interface. Click around. If it fits, it's yours for $4.99 once, with free updates.