How to get CPU temperature and fan speed on OS X?
Asked Answered
C

3

14

How do I get CPU temperature and fan speeds in OS X?

I understand that information is obtained from IOHWSensor in IOKit, but I'm unable to find any reliable information on how to exactly do that.

I've found an article with a sample program - http://www.booktou.com/node/148/0321278542/ch10lev1sec7.html, but all I get with it is the GPU temperature. I'm sure there are CPU temperature sensors on the unibody Macs, so that means I'm doing something wrong.

Courante answered 7/2, 2010 at 13:27 Comment(0)
G
8

The source code for this Prefpane that's called FanControl is avilable; it shows temperatures and fan speeds: http://www.lobotomo.com/products/FanControl/index.html

Galer answered 8/2, 2010 at 20:23 Comment(1)
the link is outdatedPreparedness
E
4

If you have npm installed, there is also cli tool called macstats. You can install it using:

[sudo] npm install macstats -g

Then just run the command and it will give you output like:

--- CPU Stats ---
CPU Temp:        33.75°C

--- Fans Stats ---
Fan 0 speed:     1996 RPM
Fan 1 speed:     2003 RPM

--- Battery Stats ---
Charged:         82%
Capacity:        92%
Cycle Count:     692 (69%)
Max Cycle Count: 1000
Current Charge:  5189 mAh
Maximum Charge:  6316 mAh
Design Capacity: 6900 mAh
Time Remaining:  6.54 h
Temperature:     30.06°C

The tools also exposes API that you can use in a custom application.
See https://github.com/jkuri/macstats for more information.

Ensoul answered 2/1, 2016 at 21:48 Comment(0)
R
0

Fanny Widget tool provide details about your Fans condition,CPU, GPU temperature details ect. Just download opensource mac app widget.

https://www.fannywidget.com/

  • It's only recommendation as per my experience.
Rentsch answered 17/12, 2021 at 5:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.