The Ultimate Guide To Power Metrics For Mac OS X
Using Terminal to Check Macbook Pro Fan Speed and To Find Macbook Pro Temperature?

With the launch of Mac OS Big Sur, most Developers, Users, and Customers are looking towards upgrading their Intel-based machines to the latest…
However, you may be curious to know how the temperatures, fan control ad power consumption may or may not have changed based on installing new software on now older hardware. “Did Apple’s Development teams take into consideration power consumption running macOS Big Sur (a 12GB update) from older Intel-based Macbooks?” Well, Here is what we found out about power consumption in MacOS X.
Thermals, Spinning Fans, and Heat 🥵
Power Metrics is an only-mac OS X Command-line Utility that can be used to determine the fan speed of your computer. “How To Get Mac CPU Temp?” for any Mac-based machine use sudo powermetrics
. This utility requires root permissions to be able to execute.
These commands will run on any macOS compatible machine in the terminal.
All MacBooks, iMacs, etc have a command-line tool intergraded for Power Consumption and Thermal Monitoring, this tool is built into macOS X.
If your device is running the latest and greatest and your fans begin to spin up unexpectedly… you may want to monitor the situation or even adjust the hardware settings on your hardware directly yourself. We will dive into this later.
Let's run a command to see all the most recent processes on your current machine.
sudo powermetrics --samplers tasks --show-process-coalition --show-process-gpu -n 1 -i 3000
The output of the terminal should show all the processes running.
*** Running tasks ***
Name ID CPU ms/s User% Deadlines
com.google.Chrome 368 248.41 - -
How do you find CPU temperature using MacOS x?
sudo powermetrics -i 200 --samplers smc | grep 'CPU die temperature'CPU die temperature: 69.54 C
CPU die temperature: 69.38 C
CPU die temperature: 69.38 C
How do you find GPU temperature using MacOS x?
sudo powermetrics -i 200 --samplers smc | grep 'GPU die temperature'GPU die temperature: 57.25 C
GPU die temperature: 57.25 C
GPU die temperature: 57.25 C
How do you find fan speed (RPM) using MacOS x?
sudo powermetrics -i 200 --samplers smc | grep 'Fan:'Fan: 2160 rpm
Fan: 2159 rpm
Fan: 2158 rpm
The purpose of Power Metrics is to monitor the thermals of your Macbook Unibody case by reading the temperatures of each component found on your machine and you can verify this with your own terminal by checking the current speed of your running fans or monitoring GPU or CPU.
With these commands, you will be able to see which programs are holding up your CPUs attention causing your processing power to be used generating Heat and an increase in fan speed may accrue.
For example, you can see we have a high usage of Google Chome.exe
running a total of 248.41
Well, that makes sense. Chromium is known for its high CPU usage.
If you are a Linux Developer you can run the following command htop
in a terminal to see a similar output of CPU usage and PIDs for all processes running on your machine.
Being that we are running MacOS X we should use powermetrics
instead to avoid installing additional software. We can also run Linux based software to monitor processes on MacOS X using Homebrew to install.
For users more comfortable with htop
feel free to install via Homebrewbrew install htop
Let's dive into the functionality of Power Metrics on MacBook Pro Hardware.
To find more information on this specific command line use the man powermetrics
command as you would in a UNIX-based terminal. The output should describe available subsystem commands for power metrics and you can begin to compose commands.
NAME
powermetrics
SYNOPSIS
powermetrics [-i sample_interval_ms] [-o order] [-t wakeup_cost] [-u output_file] [-n sample_count]
After reviewing the temperatures of your machine and realizing some programs are consuming too many CPU threads you may want to control the fans of your hardware independently.
Another powerful tool built by the open-source community is smcFanControl, this MacOs specific program can be used to adjust the speed of the fans used to cool down the hardware within a MacBook Pro unibody case and other machines.
smcfancontrol
to find out more about the project visit GitHub. This tool alone can help you learn about the hardware found in your Apple machine. All commands utilize the AppleSMC kernel making these really native to apple logic boards and should be used with your own caution. Usually, I don’t recommend software outside machine stock native programs but the open-source community has great support!
For users comfortable with downloading smcfancontrol
feel free to install via Homebrew
brew cask install smcfancontrol
From there you can run their desktop GUI, and they even have a command-line tool built. According to the open-source repo, the smc
command and can change fan speed are directly mentioned in their readme.
..to force fan 0 to 4000 RPM and leave fan 1 in automatic mode:
# smc -k "FS! " -w 0001
# smc -k F0Tg -w 3e80
..to return both fans to automatic mode:
# smc -k "FS! " -w 0000
In conclusion,
With these commands, you can have just a little bit more control of the ecosystem of Apple.
We can begin to see how powerful Mac OSx (including their latest addition of Big Sur) manages thermals for you.
Happy Coding!