专项 |
概念 |
adb命令 |
|
App启动时间 |
冷启动 |
|
启动app命令: adb shell am start -W -n package/activity
停止app命令: adb shell am force-stop package
获取运行app包名: adb logcat | grep START
|
热启动 |
|
启动app命令: adb shell am start -W -n package/activity
停止app命令: adb shell input keyevent 3
|
|
CPU
|
|
查看cpu的资源占用: Mac下: adb shell dumpsys cpuinfo | grep packagename
Windows下: adb shell dumpsys cpuinfo | findstr packagename
|
|
内存
|
|
获取app进程ID: adb shell ps | findstr pcakageName
查看App内存的占用: adb shell top -n 1 -d 0.5 | findstr pid(进程ID)
|
|
流量
|
|
获取进程ID指令: adb shell ps | grep packagename
查看Android 设备的网卡信息: adb shell netcfg 查看所有网卡流量: adb shell cat /proc/pid/net/dev
获取进程ID网卡流量: adb shell cat /proc/ pid /net/dev | findstr wlan0
|
|
电量
|
|
设置手机为非充电状态: adb shell dumpsys battery set status 1
查看电量的使用情况: adb shell dumpsys battery |findstr level
|