问题描述
(Xcode 6,OSX 10.10.3)如何以编程方式获取 Mac 的电池电量信息(充电状态、电池电量、循环次数、最大电量(以 mAH 为单位)?
(Xcode 6, OSX 10.10.3)How do I get the battery charge information of a Mac (Charge Status, Battery level, Cycle count, Maximum charge in mAH) programmatically?
推荐答案
希望对您有所帮助:
它使用未经批准的调用,因此请勿使用此代码发布您的申请,否则您可能会被拒绝!
It uses non-approved calls, so don’t post your application with this code or you may be rejected!
http://blog.coriolis.ch/2009/02/14/reading-the-battery-level-programmatically/
来自苹果;所以不要担心这个代码:https://developer.apple.com/library/ios/samplecode/BatteryStatus/Introduction/Intro.html(附完整示例代码)
From Apple; so don't worry about this code:https://developer.apple.com/library/ios/samplecode/BatteryStatus/Introduction/Intro.html (With complete sample code)
这篇关于以编程方式获取电池充电信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!