8
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MBPのバッテリー劣化をコマンドで確認する

8
Posted at

概要

Mac book proのバッテリーの劣化具合をコマンドで確認するメモ。

  1. ioreg コマンドでバッテリー情報を取得できる
  2. DesignCapacityが出荷時の容量(mAh)
  3. MaxCapacityが現在の容量(mAh)
  4. MaxCapacityDesignCapacityで割ると劣化具合がわかる。
(以下の環境で確認した)
$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.12.6
BuildVersion:	16G1036

コマンド


DesignCapacity=$(ioreg -c AppleSmartBattery | grep DesignCapacity | awk '{print $NF}')
MaxCapacity=$(ioreg -c AppleSmartBattery | grep MaxCapacity | awk '{print $NF}')
echo "MaxCapacity: "$MaxCapacity
echo "DesignCapacity: "$DesignCapacity
echo -n "AttritionRate: " && echo "scale=3; (${MaxCapacity}/${DesignCapacity}) * 100" | bc 

(結果)
MaxCapacity: 6133
DesignCapacity: 6559
AttritionRate: 93.500
8
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?