この情報は、他の多くのバッテリーやシステム情報とともにコマンドから見つけることができます
ioreg
このコマンドは、manページによれば、次のことを行います。
ioregは、I / O Kitレジストリを表示します。階層的な1レジストリ構造を逆ツリーとして示しています。
1:階層的[原文のまま]
クラス名(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ライブラリの1つです。
免責事項:SystemKitまたはBeltexとは関係ありません。SystemKitの幸せなユーザーです。