-
耗電量測試:
adb shell dumpsys batterystats --reset # 清理耗電量數(shù)據(jù)
adb shell dumpsys batterystats --enable full-wake-history # 錄制
adb bugreport bugreport.zip # android 7 收集數(shù)據(jù)
adb bugreport > bugreport.txt # android 6 收集數(shù)據(jù)
-
卡頓分析
工具: systrace
sdk/platform-tools/systrace
需要python2.7
安裝win32con : pip install pypoiwin32
使用: python systrace.py -e 設(shè)備id:端口 -l
影響因素:
- 內(nèi)存問題 : (內(nèi)存抖動(dòng)、full gc 垃圾回收)
- cpu (計(jì)算耗時(shí))
- render (復(fù)雜布局、overdraw)
- 幀分析: adb -s devicesname shell dumpsys gfxinfo | less
- 冰凍幀: 一個(gè)幀超過0.7s
adb shell dumpsys meminfo #內(nèi)存
adb shell dumpsys meminfo | findstr pkg_name # 查看某個(gè)包的內(nèi)存信息
adb shell dumpsys cpuinfo #cpu
adb shell getprop ro.product.cpu.abi #查看android cpu是32位還是64位
adb shell getprop ro.build.version.sdk # 獲取系統(tǒng)api版本
adb shell getprop ro.build.version.release # 獲取系統(tǒng)版本