このページでは、Batterystats ツールとBattery Historianスクリプトの基本的な使用方法と作業の流れについて説明します。
Batterystats は端末からバッテリーのデータを収集し、Battery Historianはそのデータをブラウザ上で見られるHTML形式に変換します。 Batterystats は the Androidフレームワークの一部で、 Battery Historian はオープンソースで GitHub の https://github.com/google/battery-historianから入手できます。
これの利点としては:
https://github.com/google/battery-historian
> adb kill-server
> adb devices
> adb shell dumpsys batterystats --reset
<disconnect and play with app>...<reconnect>
> adb devices
>adb shell dumpsys batterystats > batterystats.txt
> python historian.py batterystats.txt > batterystats.html
historian.py
ファイルを探してそれをデスクトップやその他
書込み操作が可能な ディレクトリに移動させます。historian.py
を保存したディレクトリに移動します。cd ~/Desktop
> adb kill-server
> adb devices
> adb shell dumpsys batterystats --reset
リセットをすると、収集されている古いバッテリーデータが消去されます。; リセットしないと出力結果が膨大になってしまいます。
> adb devices
> adb shell dumpsys batterystats > batterystats.txt
> python historian.py batterystats.txt > batterystats.html
batterystats.html
ファイルを開きます。