查看当前运行软件的包名和类名: adb shell "dumpsys window | grep mCurrentFocus" 进入adb shell: adb shell 查看CPU占用率: top | grep 包名(只查看指定包名
查看当前运行软件的包名和类名:
adb shell "dumpsys window | grep mCurrentFocus"
进入adb shell:
adb shell
查看CPU占用率:
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 , 12PID,USER,PR,NI,VIRT,RES,SHR,S,%CPU,%MEM,TIME+,CMDLINEtop -m 10 -s 9(-m 显示最大数量,-s按指定排序)
User 46%, System 40%, ioW 0%, IRQ 0% //CPU占用率
User 84 + Nice 1 + Sys 75 + Idle 24 + IOW 0 + IRQ 0 + SIRQ 0 = 184 // CPU使用情况
查看内存占用率:
dumpsys meminfo | grep 包名
查看耗电量:
dumpsys battery
AC powered:false 是否连接AC(电源)充电线
USB powered:true 是否连接USB(PC或笔记本USB插口)充电
Wireless powered:false 是否使用了无线电源
status: 2 电池状态,2为充电状态,其他为非充电状态
level:85 电量(%)
scale: 100. 电量最大数值
voltage: 4180 当前电压(mV)
current now: -335232. 当前电流(mA)
temperature:290电池温度,单位为0.1摄氏度
technology:Li-poly. 电池种类
每秒帧数(流畅度)[fps]:
dumpsys gfxinfo 包名
PS: 最好先adb shell 进入安卓系统,在执行adb shell之后的语句。 windows系统dos窗口中grep换成find
来源地址:https://blog.csdn.net/qq_36562656/article/details/127486216
--结束END--
本文标题: adb shell之APP性能测试
本文链接: https://www.lsjlt.com/news/372688.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-16
2024-05-16
2024-05-16
2024-05-16
2024-05-16
2024-05-16
2024-05-16
2024-05-16
2024-05-16
2024-05-16
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0