app電量
adb shell dumpsys battery set status 1 #手機(jī)切換到非充電狀態(tài) 2 為充電 測(cè)試時(shí)間半個(gè)小時(shí)到一個(gè)小時(shí)以上
==============================================
Current Battery Service
AC powered: false
USB powered: true
Wireless powered: fals
Max charging current:
status: 2
health: 2
present: true
level: 61 #電量
scale: 100
voltage: 4036
temperature: 282
technology: Li-ion
測(cè)試方法:同行業(yè)知名APP或者其他版本相同操作比對(duì)
app啟動(dòng)時(shí)間(冷啟動(dòng))
命令行運(yùn)行adb logcat|findstr START 后,啟動(dòng)程序有啟動(dòng)日志查看包用
--->adb shell am start -W -n com.xianglin.app/.biz.SplashActivity 啟動(dòng)
=================================================================
Starting: Intent { cmp=com.xianglin.app/.biz.SplashActivity }
Status: ok
Activity: com.xianglin.app/.biz.SplashActivity
ThisTime: 1515 #啟動(dòng)耗時(shí)
TotalTime: 1515
WaitTime: 1525
Complete
---->adb shell am force-stop package (冷啟動(dòng)退出app)強(qiáng)制停止啟動(dòng)
---->adb shell input keyevent 3 (熱啟動(dòng)退出,3是home鍵)
冷啟動(dòng):進(jìn)程首次創(chuàng)建 并占資源的過(guò)程
熱啟動(dòng):應(yīng)用退到后臺(tái)后啟動(dòng)
測(cè)試方法:在采集從第2次開始算平均值,查看啟動(dòng)的數(shù)據(jù)波動(dòng),可以跟同行業(yè)知名APP或者其他版本的APP比較
獲取cpu利用率
adb shell dumpsys cpuinfo|findstr com.xianglin.app
===================================================
cpu利用率
0.2% 22182/com.xianglin.app: 0.1% user + 0% kernel / faults: 529 minor
0.1% 22227/com.xianglin.app:jpushservice: 0% user + 0% kernel / faults: 1259 minor
0% 22261/com.xianglin.app:ipc: 0% user + 0% kernel / faults: 37 minor
測(cè)試方法:在利用率可接受范圍內(nèi),繼續(xù)操作,看cpu是不是持續(xù)增長(zhǎng)
獲取內(nèi)存:
adb shell dumpsys meminfo com.xianglin.app -d
=========================================================
Applications Memory Usage (kB):
Uptime: 112056300 Realtime: 634739966
** MEMINFO in pid 3907 [com.xianglin.app] **
Pss Private Private Swapped Heap Heap Heap
Total Dirty Clean Dirty Size Alloc Free
------ ------ ------ ------ ------ ------ ------
Native Heap 9918(注意) 9800 0 0 18176 16570 1605
Dalvik Heap 22725(注意) 22660 0 0 25906 15777 10129
Dalvik Other 2615 2612 0 0
Stack 692 692 0 0
Ashmem 130 128 0 0
Gfx dev 9364 9364 0 0
Other dev 9 0 8 0
.so mmap 6212 2148 128 0
.apk mmap 704 0 212 0
.ttf mmap 11 0 4 0
.dex mmap 11478 12 5616 0
.oat mmap 3185 0 836 0
.art mmap 2040 1364 8 0
Other mmap 216 108 56 0
Unknown 381 376 0 0
TOTAL 69680(注意) 49264 6868 0 44082 32347 11734
App Summary
Pss(KB)
------
Java Heap: 24032
Native Heap: 9800
Code: 8956
Stack: 692
Graphics: 9364
Private Other: 3288
System: 13548
TOTAL: 69680 TOTAL SWAP (KB): 0
Objects
Views: 17(注意) ViewRootImpl: 2
AppContexts: 6 Activities: 3(注意)
Assets: 5 AssetManagers: 4
Local Binders: 46 Proxy Binders: 36
Parcel memory: 18 Parcel count: 74
Death Recipients: 4 OpenSSL Sockets: 4
SQL
MEMORY_USED: 0
PAGECACHE_OVERFLOW: 0 MALLOC_SIZE: 62
Asset Allocations
zip:/data/user/0/com.tencent.mm/app_tbs/core_share/res.apk:/resources.arsc: 96K
測(cè)試方法:
后臺(tái)運(yùn)行(5~10分鐘為宜)和用戶持續(xù)頻繁大量操作(10~15分鐘為宜)
Native/Dalvik 堆信息 如果值一直增長(zhǎng),可能出現(xiàn)內(nèi)存泄露
Objects Activity和View (查看前先進(jìn)行GC,進(jìn)入界面之前查看Activity和View的數(shù)據(jù),退出去之后在查看一遍Activity和View的數(shù)據(jù),如果存在差異,可能存在內(nèi)存泄露)
獲取流量;
1.獲取應(yīng)用的進(jìn)程
adb shell ps|findstr package
adb shell cat /proc/(上面獲取的pid)/net/dev #關(guān)注( Receive (接收的流量)| Transmit(發(fā)送的流量))
Receive+Transmit = 應(yīng)用的流量
測(cè)試方法:上下兩個(gè)版本相同的步奏操作 來(lái)對(duì)比采集的消耗流量值
FPS:frames per second 每秒幀數(shù) 安卓系統(tǒng)中規(guī)定每秒60幀 應(yīng)用流暢 每幀大于16毫秒,應(yīng)用出現(xiàn)卡頓現(xiàn)象,具體用戶體驗(yàn)為準(zhǔn)
手機(jī)上 設(shè)置-->開發(fā)者選項(xiàng)--->GPU呈現(xiàn)模式分析--->屏幕顯示條形圖
過(guò)度渲染:描述的是屏幕上某個(gè)像素在同一幀的時(shí)間內(nèi)被繪制了多次 設(shè)置---開發(fā)者選項(xiàng)---GPU過(guò)度繪制(用戶不應(yīng)該在頁(yè)面上看見的東西,提前繪制出來(lái))