pmset - macOS


Overview

pmset is a macOS command-line tool for managing power settings on Mac computers. It allows users to set system-wide power policies, create custom sleep schedules, and retrieve information about the current power state.

Syntax

pmset [subcommand] [parameters]

Subcommands

Common Subcommands:

  • -g: Get current power settings
  • -a: Set power settings
  • -b: Copy power settings from another Mac
  • -c: Schedule sleep or wake
  • -l: List power logs

Specific Subcommands:

  • autopoweroff: Control automatic power off
  • autorestart: Control automatic restart
  • batt: Manage battery settings
  • disksleep: Control disk sleep
  • gpuswitch: Control GPU power switching
  • hibernatemode: Set hibernation mode
  • lidwake: Control lid-open wakeup
  • log: Manage power logs
  • sleep: Control sleep settings
  • wake: Control wake settings

Options/Flags

Common Options

  • -mlog: Log messages to console
  • -nointeraction: No user interaction; won’t prompt for password
  • -s: Silent operation; no output displayed

Examples

Get Current Power Settings

pmset -g

Set Sleep Schedule

pmset -c "sleep 00:00"

Create Custom Battery Policy

pmset -b "DarkWake 0"

Copy Power Settings from Another Mac

pmset -b "SavedSettings"

Common Issues

Time Zone Issues

Ensure the system time zone is set correctly, as it can affect scheduled sleep and wake times.

Permission Denied

If pmset commands require a password, use sudo to elevate privileges.

Integration

  • With Powermetrics: Monitor and log detailed power usage data.
  • With Energy Saver: Configure power settings through the GUI.
  • With launchd: Schedule power-related tasks.
  • nvram
  • log
  • man pmset