macOS power-off USB 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 such as a docking station is plugged in without a power adapter. pmset macOS command utility can set USB ports to power-off when the lid is closed. 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” value.
- 3: sleep mode with power on to USB ports.
- 25: DeepSleep hibernate, which powers off USB ports.
pmset -a hibernatemode 25
Test this by pushing the power button or closing the laptop lid. Wait a minute to see if the USB device loses power. A USB power analyzer (volt meter) can be used to check the USB port power as well.