app 專項(xiàng)測試

  • 耗電量測試:

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)版本
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容