椰子电池如何确定Macbook电池的设计容量?


11

MacBook的电池具有三个充电号:

  1. 当前充电
  2. 最高收费
  3. 设计能力

即使Macbook仍处于插入状态,只要(1)是(2)的95%,OS X也不会尝试充电,这就是为什么通知栏中的百分比通常在95%和100%之间的原因。

这两个数字与电池的“设计容量”相反。 我发现椰子电池是唯一报告Macbook电池“设计容量”的软件。

此设计功能未出现在Apple的规格,系统信息或everymac.com中。

椰子电池如何确定电池的设计容量?


iStat菜单还显示电池的设计容量
也许是2016年

6
在这里我以为椰子电池就像柠檬电池。真令人失望。
2016年

Answers:


27

您可以从命令中找到此信息以及其他许多电池和/或系统信息

ioreg

根据其手册页,此命令执行以下操作:

ioreg显示I / O Kit注册表。它以分层树的形式显示了1类注册表结构。

1:分层[sic]

使用按类名称的过滤器(AppleSmartBattery用于电池)仅获取与电池有关的信息:

$ ioreg -brc AppleSmartBattery
-b    Show the object name in bold.
-r    Show subtrees rooted by objects that match the specified criteria.
       If none of -c, -k, or -n are supplied, -r has no effect.
-c    Show the object properties only if the object is an instance of, or
       derives from, the specified C++ class (e.g. IOService).

来自man ioreg

将打印如下内容:

$ ioreg -brc AppleSmartBattery
+-o AppleSmartBattery  <class AppleSmartBattery, id 0x100000254, registered, ma$
{
  "ExternalConnected" = Yes
  "TimeRemaining" = 0
  "InstantTimeToEmpty" = 65535
  "ExternalChargeCapable" = Yes
  "FullPathUpdated" = 1464849055
  "CellVoltage" = (4298,4292,4299,0)
  "Voltage" = 12889
  "BatteryInvalidWakeSeconds" = 30
  "AdapterInfo" = 0
  "MaxCapacity" = 5524
  "PermanentFailureStatus" = 0
  "Manufacturer" = "SMP"
  "Location" = 0
  "CurrentCapacity" = 5524
  "LegacyBatteryInfo" = {"Amperage"=0,"Flags"=5,"Capacity"=5524,"Current"=5$
  "FirmwareSerialNumber" = 1
  "BatteryInstalled" = Yes
  "PackReserve" = 200
  "CycleCount" = 318
  "DesignCapacity" = 6330
  "OperationStatus" = 58371
  "ManufactureDate" = 17726
  "AvgTimeToFull" = 65535
  "BatterySerialNumber" = "D864403T3UVFVN7A6"
  "BootPathUpdated" = 1464353527
  "PostDischargeWaitSeconds" = 120
  "Temperature" = 3096
  "UserVisiblePathUpdated" = 1464849490
  "InstantAmperage" = 0
  "ManufacturerData" = <000000000702000a03890000034a34340330304103534449032$
  "MaxErr" = 1
  "FullyCharged" = Yes
  "DeviceName" = "bq20z451"
  "IOGeneralInterest" = "IOCommand is not serializable"
  "Amperage" = 0
  "IsCharging" = No
  "DesignCycleCount9C" = 1000
  "PostChargeWaitSeconds" = 120
  "AvgTimeToEmpty" = 65535
}

您正在寻找的领域是DesignCapacity。为方便起见,将其过滤掉grep(单位为毫安小时或mAh):

$ ioreg -brc AppleSmartBattery | grep DesignCapacity
      "DesignCapacity" = 6330

您的DesignCapacity字段可能不会显示6330为其值。我正在使用2014年中期的13英寸rMBP,但您可能正在使用另一台电池额定功率不同的系统。

除了电池信息外,ioreg还可用于查找有关系统和其他外围设备的更多信息-有点像命令行系统信息工具。


如果您正在寻找此命令的代码实现,请在Github上查看Beltex的SystemKit。这是我所知道的最酷的Swift库之一。

免责声明:不隶属于SystemKit或Beltex。只是SystemKit的快乐用户。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.