APP越来越大,功能越来越多,导致后台运行时耗电急速上升,使用官方推荐的Baterry-Historian进行分析 官方链接:https://github.com/google/battery-historian
docker run -p 8888:9999 gcr.io/android-battery-historian:2.1 --port 9999
其中8888就是本地端口号,如果本地没有gcr.io/android-battery-historian:2.1的话,就会从server开始下载
BatteryHistorian
adb shell dumpsys batterystats --enable full-wake-history
adb shell dumpsys batterystats --reset
adb bugreport <zip_file>
bugreport > bugreport.txt
命令会提示以下警告:
WARNING: flat bugreports are deprecated, use adb bugreport <zip_file> instead