主要分为2步骤
1、收集app耗电数据
adb devices #连接手机
adb shell dumpsys batterystats --reset #初始化数据,清空重新统计
adb shell dumpsys batterystats --enable full-wake-history #开始唤醒统计
adb shell dumpsys batterystats > batterystats.txt #导出为txt
2、导出数据,报表分析
可以通过Battery Historian将batterystats.txt 生成html文件格式
2.1、下载https://github.com/google/battery-historian
2.2、运行python historian.py batterystats.txt > batterystats.html



