如何在Mac上获取电量 [英] How to get power usage on a Mac

查看:202
本文介绍了如何在Mac上获取电量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取功耗(以瓦特为单位),但我不知道如何使用.我查看了pmset和IOKit,但找不到任何信息. coconutBattery 可以使用 MacOS内部电源信息为笔记本电脑计算它.

I'm trying to get the power usage (in watts) but I can't figure out how. I looked at pmset and IOKit but couldn't find anything about it. coconutBattery can calculate it for laptops using the MacOS internal power information.

推荐答案

/usr/sbin/system_profiler SPPowerDataType | grep Wattage

该实用程序还接受-xml标志; XML中的特定键为sppower_ac_charger_watts.

The utility also accepts an -xml flag; the specific key in the XML is sppower_ac_charger_watts.

这篇关于如何在Mac上获取电量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆