Check Your Mac's Battery Level from the Command Line

April 22, 2019

Estimated time: 1m Difficulty: 1/5

This guide will explain how to find out information about the state of a Mac's battery from the command line. This can be useful if you are controlling a remote machine via SSH, if you are in single-user mode, or if you are having problems within macOS and need to bypass the GUI.

NOTE If your Mac does not have an internal battery, as is the case with Apple's desktop machines, you will obviously not receive any useful information when running this command.

Run the Command

From the command line, type:


      pmset -g batt

If your Mac has an internal battery, you will see a response that looks like this:

Now drawing from ‘AC Power’
-InternalBattery-0 (id=12345678) 81%; charging; 1:19 remaining present: true

If your Mac does not have an internal battery, you will see the following output and nothing else besides:

Now drawing from ‘AC Power’

Understanding the Output

The response is fairly straightforward. If the Mac is plugged in, it will say:

Now drawing from ‘AC Power’

If the Mac is not plugged in, it will say:

Now drawing from ‘Battery Power’

The percentage next to –InternalBattery-0 is how much charge is currently left in the battery.

charging indicates that the battery is . . . well, charging. If the battery is fully charged, it will say charged

1:19 remaining indicates how much more time will elapse before the battery is fully charged

Versions

macOS: 10.14.4
Notice an error?

Have we got something wrong? Please let us know and we’ll fix it right away.

Categories
Apple iOS Mac macOS

Join the Discussion

Your email address will not be published. Required fields are marked *