Battery status API in macOS?

If you’re looking for a quick way to query it from the command line, you’ll find the pmset command helpful. To query the battery status, specifically, use:

$ pmset -g batt

Leave a Comment