macOS power-off USB ports on sleep

By default, macOS keeps USB ports constantly providing power while in sleep mode, which can run down the laptop battery if a USB device is plugged in. A simple command line setting can be used to power off USB ports on sleep. This works by putting the laptop into hibernate mode, which makes the laptop wake up a few seconds slower than the standard sleep.

Get current power settings:

pmset -g

Note the “hibernatemode”, it’s probably “3”, which according to “man pmset” is sleep mode with power to USB ports. Typically “25” is hibernate mode, which powers off USB ports.

pmset -a hibernatemode 25

Test this by pushing the power button on the laptop, and wait a few minutes to see if the USB device loses power. Another way to check if the USB device doesn’t have indicators is to note the laptop battery percent before sleep, and then put the laptop to sleep and check the laptop battery after several hours–it should not go down if the USB devices are powered off. Of course, a USB power analyzer (volt meter) can be used to check the USB port power as well.