Taking Control of Mac Power Management
macOS is famous for its aggressive, highly optimized power management. Your MacBook constantly analyzes your usage, dimming the screen, putting the hard drive to sleep, and throttling the CPU to squeeze every possible minute out of the battery.
For most users, the basic graphical sliders in System Settings > Displays or Energy Saver are sufficient. But what if you are a video editor rendering a massive 4K project overnight and your Mac keeps going to sleep? What if you are a system administrator who needs to schedule a fleet of iMacs to boot up automatically at 6:00 AM every Monday?
To access the hidden, granular power management capabilities of macOS, you must use the Terminal and the pmset (Power Management Settings) command.
Step 1: Viewing Your Current Power Settings
Before you make any changes, it is critical to understand your Mac’s current configuration. Open the Terminal app and type the following command to view a custom readout of all active power settings:
pmset -g custom
The output will be divided into different sections based on your power source (e.g., Battery Power vs. AC Power).
You will see values for variables like:
displaysleep: Minutes of inactivity before the screen turns off.disksleep: Minutes before the hard drive spins down (mostly relevant for older Macs).sleep: Minutes before the entire system goes into deep sleep.tcpkeepalive: Whether the Mac maintains network connections while sleeping.
A value of 0 usually means “never” or “disabled.”
Step 2: Preventing Sleep During Critical Tasks
If you have a critical task running (like a massive file download or a software compile) and you want to ensure the Mac never goes to sleep while plugged into the wall, you can modify the AC power profile.
Because you are changing hardware-level system behaviors, you must use sudo to execute the command as an administrator.
To set the system sleep timer to “never” (0) when on AC power, run:
sudo pmset -c sleep 0
(Note: The -c flag targets the Charger/AC profile. If you wanted to target the Battery profile, you would use -b. To target all profiles universally, use -a).
Step 3: Scheduling Automatic Boot and Shutdown Times
One of the most powerful features of pmset is the ability to schedule automatic power events. If you manage a small office, you can set the Macs to turn on before employees arrive and shut down after they leave, saving electricity.
The syntax for scheduling requires specific formatting: days of the week are represented by letters (M, T, W, R, F, S, U) and time must be in 24-hour HH:MM:SS format.
To schedule the Mac to automatically wake up (or power on) every Monday through Friday at 7:30 AM:
sudo pmset repeat wakeorpoweron MTWRF 07:30:00
To check your scheduled events to ensure you typed it correctly, run:
pmset -g sched
If you want to cancel all scheduled power events and return to normal, run:
sudo pmset repeat cancel
Step 4: Finding Out What is Keeping Your Mac Awake
Have you ever closed your MacBook lid, put it in your backpack, and pulled it out three hours later to find it burning hot with a dead battery? Something prevented it from sleeping.
You can use pmset to interrogate the system and find out exactly which application or process is currently blocking the sleep function.
pmset -g assertions
This will output a massive list of system states. Look closely at the section titled Listed by owning process. You might see a line indicating that Google Chrome is playing audio, or that a backup utility has asserted a “PreventUserIdleSystemSleep” lock.
Step 5: Restoring Factory Defaults
If you experiment with pmset, mess up your battery life, and cannot remember what you changed, you do not need to reinstall macOS.
You can instantly wipe all custom configurations and restore Apple’s highly optimized factory default power settings by running:
sudo pmset -a restoredefaults