pmset

Power management settings.

Syntax

   Settings for battery(b),charger(c), UPS(u), all(a):
      pmset [-a | -b | -c | -u] [setting value] [...]

   List current settings (Get)
      pmset -g [custom | live | cap | sched | ups | ps | ...full Getting list below]

   UPS settings:
      pmset -u [haltlevel percent] [haltafter minutes] [haltremain minutes]

   Override settings and sleep now:
      pmset [sleepnow | displaysleepnow | boot | noidle | lock | touch]

      pmset relative [wake | poweron] seconds

   Schedule:
      pmset schedule [cancel] [cancelall] {sleep | wake | poweron | shutdown | wakeorpoweron}
               "MM/dd/yy HH:mm:ss" [owner]

      pmset repeat cancel

      pmset repeat {sleep | wake | poweron | shutdown | wakeorpoweron}
               weekdays "MM/dd/yy HH:mm:ss"
               Where weekdays is a subset of MTWRFSU ("M" and "MTWRF" are valid strings)

Key:
SETTINGS

   displaysleep - Display sleep timer; replaces 'dim' argument in 10.4
                 (value in minutes, or 0 to disable)
   disksleep  - Disk spindown timer; replaces 'spindown' argument in 10.4
                (value in minutes, or 0 to disable)
   sleep      - System sleep timer (value in minutes, or 0 to disable)
   womp       - Wake on ethernet magic packet (value = 0/1)
   ring       - Wake on modem ring (value = 0/1)
   powernap   - Enable/disable Power Nap on supported machines (value = 0/1)
   proximitywake - On supported systems, this option controls system wake from sleep based
on proximity of devices using same iCloud id. (value = 0/1) autorestart - Automatic restart on power loss (value = 0/1) reduce - Reduce processor speed (value = 0/1) powerbutton - Sleep the machine when power button is pressed (value=0/1) lidwake - Wake the machine when the laptop lid (or clamshell) is opened (value = 0/1) acwake - wake the machine when power source (AC/battery) is changed (value = 0/1) lessbright - Slightly turn down display brightness when switching to this power source (value = 0/1) halfdim - Display sleep will use an intermediate half-brightness state between full brightness and fully off (value = 0/1) sms - Use Sudden Motion Sensor to park disk heads on sudden changes in G force (value = 0/1) hibernatemode - Change hibernation mode. (value =integer) Please use caution not all hardware supports all modes. 0 = normal sleep, 1 = hibernate mode, 3 = safe sleep, 25 = hibernate mode for post-2005 portable Macs. hibernatefile - Change hibernation image file location. Image can only be located on the root volume. Please use caution. (value = path) ttyskeepawake - Prevent idle system sleep when any tty (e.g. remote login session) is 'active'. A tty is 'inactive' only when its idle time exceeds the system sleep timer. (value = 0/1) networkoversleep - This setting affects how macOS networking presents shared network services during system sleep. This setting is not used by all platforms; changing its value is unsupported. destroyfvkeyonstandby - Destroy File Vault Key when going to standby mode. By default File vault keys are retained even when system goes to standby. If the keys are destroyed, user will be prompted to enter the password while coming out of standby mode.(value: 1 - Destroy, 0 - Retain) GETTING -g (with no argument) display the settings currently in use. -g live Display the settings currently in use. (default if no argument given) -g custom Display custom settings for all power sources, although these settings might not currently be in use; a pre-set settings profile might be active instead. -g cap Display which power management features the machine supports. -g sched Display scheduled startup/wake and shutdown/sleep events. -g ups Display UPS emergency thresholds. -g ps /batt Display status of batteries and UPSs. -g pslog Display an ongoing log of power source (battery and UPS)state. -g rawlog Display an ongoing log of battery state as read directly from battery. -g therm Show thermal conditions that affect CPU speed. Not available on all platforms. -g profiles Display the settings associated with each Energy Saver profile. 10.5+ -g thermlog Show a log of thermal notifications that affect CPU speed. Not available on all platforms. -g assertions Display a summary of power assertions. Assertions can prevent system sleep or display sleep. 10.6+ -g assertionslog Show a log of assertion creations and releases. 10.6+ -g sysload Display the "system load advisory" - a summary of system activity available from the IOGetSystemLoadAdvisory API. 10.6+ -g sysloadlog Display an ongoing log of lives changes to the system load advisory. 10.6+ -g ac / adapter Display details about an attached AC power adapter. Only supported for MacBook and MacBook Pro. -g log Display a history of sleeps, wakes, and other power management events. This log is for admin & debugging purposes. -g uuid Display the currently active sleep/wake UUID; used within macOS to correlate sleep/wake activity within one sleep cycle. history -g uuidlog Display the currently active sleep/wake UUID, and prints a new UUID as they're set by the system. -g history A debugging tool. Prints a timeline of system sleeplwake UUIDs, when enabled with boot-arg io=0x3000000. -g historydetailed Print driver-level timings for a sleep/wake. Pass a UUID as an argument. -g powerstate [class names] Print the current power states for I/O Kit drivers. Caller may provide one or
more I/O Kit class names (separated by spaces) as an argument. If no classes are provided, it will print all drivers' power states.
-g powerstatelog [-i interval] [class names] Periodically print the power state residency times for some drivers.
Caller may provide one or more I/O Kit class names (separated by spaces). If no classes are provided, it will log the IOPower plane's root registry
entry. Caller may specify a polling interval, in seconds with -i <polling interval>;
otherwise it defaults to 5 seconds.
-g stats Print the counts for number sleeps and wakes system has gone thru since boot.
-g systemstate Print the current power state of the system and available capabilites. -g everything Print output from every argument under the GETTING header. This is useful for quickly collecting all the output that pmset provides.10.8+

pmset must be run as root in order to modify any settings.
See man pmset for a description of power management with more examples.

In system preferences ➞ Energy saver you can set Sleep times and 'Wake for Network Access'

Hibernation and Safe Sleep modes will turn OFF RAM memory during sleep.

The macOS Energy Saver preference file is stored at:
/Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist
If energy saving preferences are not 'sticking', then trashing this preference file and rebooting will usually fix things.

Scheduled power on/off events are stored separately in /Library/Preferences/SystemConfiguration/com.apple.AutoWake.plist

Examples

Print the power management settings in use by the system:
$ pmset -g

Set displaysleep to a 5 minute timer on battery power
$ sudo pmset -b displaysleep 5

Restore default settings for charger, battery and UPS:
$ sudo pmset -c 2 -b 1 -u 1

Set the hibernation mode to normal sleep:
$ sudo pmset -a hibernatemode 0

Restart the computer at midnight every day:
$ sudo pmset repeat restart MTWRFSU 00:00:00

Cancel those repeating tasks:
$ sudo pmset repeat cancel

“Work like you don't need the money, love like you've never been hurt, and dance like nobodys watching” ~ Satchel 'Satchmo' Paige

Related macOS commands

caffeinate - Prevent the system from sleeping.


 
Copyright © 1999-2024 SS64.com
Some rights reserved