V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
ChrisFreeMan
V2EX  ›  macOS

各位大佬, MacOS 有什么命令可以实时获取 CPU 温度的吗,我想自己写个状态栏监控自己用

  •  
  •   ChrisFreeMan · 2022-02-27 13:13:33 +08:00 · 2468 次点击
    这是一个创建于 801 天前的主题,其中的信息可能已经有所发展或是发生改变。
    5 条回复    2022-02-27 14:19:20 +08:00
    mons
        1
    mons  
       2022-02-27 13:40:38 +08:00   ❤️ 1
    1. Intel Mac 可以直接用 powermetrics 读 smc 拿 CPU 温度

    sudo powermetrics --samplers smc | grep -i "CPU die temperature"

    Source: https://apple.stackexchange.com/a/372928

    2. M1 Mac 目前好像没法用自带 CLI 读取(没实现),得用 API ,见 https://github.com/yujitach/MenuMeters/commit/5604e769b9bf5cc0a5ee6f0c6f99ecca570f1b37#diff-69ec57a2eaee2a9eae215332a60e6b2ce67e378314670e5112c39029f445ab3aR54-R72

    Source: https://stackoverflow.com/a/68864575 )
    ChrisFreeMan
        3
    ChrisFreeMan  
    OP
       2022-02-27 13:45:11 +08:00
    @mons
    @foam 多谢、多谢我了解下
    Macolor21
        4
    Macolor21  
       2022-02-27 14:14:10 +08:00   ❤️ 1
    可以看下开源的 Mac 状态栏监控的实现? https://github.com/exelban/stats
    atangdi
        5
    atangdi  
       2022-02-27 14:19:20 +08:00 via Android
    柠檬就有了现在
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1065 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 22:22 · PVG 06:22 · LAX 15:22 · JFK 18:22
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.