【问题标题】:How to get CPU temperature and fan speed on OS X?如何在 OS X 上获取 CPU 温度和风扇速度?
【发布时间】:2011-01-14 02:02:17
【问题描述】:

如何在 OS X 中获取 CPU 温度和风扇速度?

我知道信息是从IOKit 中的IOHWSensor 获得的,但我无法找到任何可靠的信息来说明如何准确地做到这一点。

我找到了一篇带有示例程序的文章 - http://www.booktou.com/node/148/0321278542/ch10lev1sec7.html,但我得到的只是 GPU 温度。我确定一体式 Mac 上有 CPU 温度传感器,所以这意味着我做错了。

【问题讨论】:

    标签: macos iokit temperature


    【解决方案1】:

    这个名为 FanControl 的 Prefpane 的源代码是可用的;它显示温度和风扇速度:http://www.lobotomo.com/products/FanControl/index.html

    【讨论】:

      【解决方案2】:

      如果你安装了 npm,还有一个名为 ma​​cstats 的 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

      【讨论】:

        【解决方案3】:

        Fanny Widget 工具提供有关您的风扇状况、CPU、GPU 温度等详细信息的详细信息。只需下载开源 mac 应用小部件即可。

        https://www.fannywidget.com/

        • 根据我的经验,这只是建议。

        【讨论】:

          猜你喜欢
          • 2021-10-20
          • 1970-01-01
          • 2013-06-14
          • 2013-10-02
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2014-06-12
          相关资源
          最近更新 更多