如何在OS X上获得CPU温度和风扇速度?
-
19-09-2019 - |
题
如何在OS X中获得CPU温度和风扇速度?
我了解信息是从 IOHWSensor
在 IOKit
, ,但是我找不到有关如何准确执行此操作的任何可靠信息。
我找到了带有示例程序的文章 - http://www.booktou.com/node/148/0321278542/ch10lev1sec7.html, ,但我所得到的只是GPU温度。我敢肯定,Unipody Mac上有CPU温度传感器,因此这意味着我做错了什么。
解决方案
这个名为fancontrol的源代码是可用的;它显示了温度和风扇速度: http://www.lobotomo.com/products/fancontrol/index.html
其他提示
如果安装了NPM,也有CLI工具称为 麦克斯塔特. 。您可以使用:
[sudo] npm install macstats -g
然后只需运行命令,它将为您提供像以下内容一样的输出。
--- 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
这些工具还可以公开您可以在自定义应用程序中使用的API。
看 https://github.com/jkuri/macstats 了解更多信息。
不隶属于 StackOverflow