Why does my Mac keep waking up from sleep?
Find out what is waking your Mac and stop it, using only built-in macOS power-management tools.
What this covers
A Mac that keeps waking on its own drains battery overnight and is annoying to live with. The fix is almost always identifiable: the log records exactly why the machine woke, and the settings tools let you change what needs changing. This guide walks you from diagnosis to a verified fix.
Symptom
Find out what woke the Mac
The power management log records the reason for every sleep and wake event — lid open, keyboard input, network traffic, Bluetooth, and more. Read the last twenty events and look for a repeating wake source. If the same cause shows up every time, that is your culprit.
Read the power management event log to see sleep and wake reasons, e.g. lid, keyboard, network or Bluetooth.
$ pmset -g log | grep -E "Entering Sleep|Wake from|DarkWake from" | tail -20Check what is preventing or interrupting sleep
Apps can hold a power assertion that blocks sleep or triggers a dark wake. The assertions list names each one, so you can spot a runaway app, an audio stream, or a screen-sharing session keeping the machine awake. Once the named process is closed, the assertion should disappear.
List every power assertion — the named reason an app, audio stream, or screen share blocks sleep.
$ pmset -g assertionsRead your current sleep settings
Before changing anything, print the live configuration — battery and charger are listed separately. Look for wake-on-network options and unusually short or zero sleep timers that make the Mac wake easily. Note the values so you can compare after fixing.
pmset -g custom prints the live sleep configuration separately for battery and charger.
$ pmset -g customSet a sane idle-sleep timer
If the sleep timer is too short or unset, the Mac cycles between sleep and wake constantly. Set a clear idle-sleep threshold and read the value back to confirm it took effect. Setting 0 disables system sleep entirely — use that only deliberately.
Set exactly how many minutes of inactivity pass before the Mac sleeps, from the command line, and read the current value back.
$ sudo systemsetup -setcomputersleep 15 && sudo systemsetup -getcomputersleep▾ Undo
$ sudo systemsetup -setcomputersleep 0Optionally hold the Mac awake during a long task
Sometimes the wake problem is the opposite: you need the Mac to stay awake for a download or render without changing system settings. caffeinate can suppress display sleep for a fixed period and ends on its own, so nothing is left running afterwards.
caffeinate holds sleep off while a command runs, or for a fixed number of seconds.
$ caffeinate -d -t 3600Verify the Mac sleeps and stays asleep
Put the Mac to sleep manually and give it a minute without touching it. If it does not wake on its own, then re-run the wake log from the first step: no new unexplained wake entries should appear after your fix.
pmset includes two one-shot commands: displaysleepnow blanks the screen, sleepnow puts the whole Mac to sleep.
$ pmset displaysleepnowHow to confirm it worked
After fixing, put the Mac to sleep manually and leave it alone. Re-check the wake log: no new unexplained wake entries should appear.
Undo everything
Every command above can be reverted. Run these in order to undo all of it.
$ sudo systemsetup -setcomputersleep 0Review before running — some steps may not be independent.
Sources
- systemsetup(8) man pageEvidence: The systemsetup man page describes -setcomputersleep as setting the system sleep amount in minutes and -getcomputersleep as displaying it.
- caffeinate — prevent sleep (macOS man page)Evidence: Documents flags -d (display), -i (system idle), -m (disk), -s (system) and -t seconds for a timed assertion.
- pmset(1) man pageEvidence: Lists `-g log` among the -g getter options: display the system power management log including sleep and wake entries with their reasons.
- pmset - Power management settingsEvidence: Documents `pmset -g log`: 'Display a history of sleeps, wakes, and other power management events', noting the log is for admin and debugging purposes.
- systemsetup - Set System Configuration PreferencesEvidence: Documents -setcomputersleep minutes (0 = never) and -getcomputersleep for reading the current idle-sleep timer.
Last verified: 2026-09-21
Related guides
Check battery health, hunt down CPU-hungry and sleep-blocking processes, and tune sleep settings to stop fast battery drain on macOS.
Track down everything macOS launches for you at login — Login Items, launchd user agents and system daemons — from the Terminal, then switch off the ones you never asked for.
Find the process overheating your Mac with one-shot CPU snapshots, live monitors and disk/network tracing, then fix the cause and verify the machine cools down.