APP performance test of adb shell

1. View the package name and class name of the currently running software:

adb shell "dumpsys window | grep mCurrentFocus"

insert image description here

2. Enter the adb shell:

adb shell

3. Check the CPU usage:

top  | grep 包名(只查看指定包名的CPU占用率)
top -m 10 -s cpu(-m 显示最大数量,-s按指定排序)



使用时要把CPU换成9,因为会报  top: not integer: cpu  
adb shell top -s命令只支持0-X数字,默认9,猜测分别指代
 0 , 1  ,3 , 4,  5 , 6 , 7 ,8,  9 , 10 , 11 ,  12
PID,USER,PR,NI,VIRT,RES,SHR,S,%CPU,%MEM,TIME+,CMDLINE

top -m 10 -s 9(-m 显示最大数量,-s按指定排序)

insert image description here

User 46%, System 40%, IOW 0%, IRQ 0% //CPU usage
User 84 + Nice 1 + Sys 75 + Idle 24 + IOW 0 + IRQ 0 + SIRQ 0 = 184 // CPU usage

4. View memory usage:

dumpsys meminfo | grep 包名

insert image description here

5. View power consumption:

dumpsys battery

AC powered: false Whether to connect AC (power supply) charging cable
USB powered: true Whether to connect to USB (PC or notebook USB socket) for charging
Wireless powered: false Whether to use wireless power
status: 2 Battery status, 2 is charging status, others are non Charging status
level: 85 Power (%)
scale: 100. Maximum power value
voltage: 4180 Current voltage (mV)
current now: -335232. Current current (mA)
temperature: 290 Battery temperature, the unit is 0.1 degrees Celsius
technology: Li-poly . Battery type
insert image description here

7. Frames per second (fluency) [fps]:

dumpsys gfxinfo 包名

insert image description here

PS: It is best to enter the Android system through the adb shell first, and execute the statement after the adb shell. Replace grep with find in the dos window of windows system

Guess you like

Origin blog.csdn.net/qq_36562656/article/details/127486216