查看APP包名以及activity名
查看设备ID : adb devices
查看设备中说有的包:adb shell pm list packages
查看启动项:adb shell dumpsys activity | findstr "关键字"
adb shell dumpsys window w | findstr \/ | findstr name=
adb shell dumpsys window w | findstr \/ | findstr name=
adb shell dumpsys window w | findstr \/ | findstr name=
需要开启 app 写法最优
查看包名和activity
cmd命令输入:adb logcat>D:/log.log,即将日志存入D盘下的log文件中,运行手机上对应的app,然后停止logcat,停止使用ctrl+C,然后就可以从log.log文件中通过下图方式查找
adb shell "dumpsys window | grep mCurrentFocus"
adb shell "dumpsys window | grep mCurrentFocus"
adb shell "dumpsys window | grep mCurrentFocus"
注意:双引号千万不能省略
查看系统版本:adb shell getprop ro.build.version.release
查看APPpackage和activity: adb shell dumpsys window windows | findstr mFocusedApp
查看APP包名以及activity名:adb logcat | find "Displayed"
查看APP启动时间:adb shell am start -W welab.bank.mobile.stage/com.welabfrontend.MainActivity
查看APP内存命令:adb shell dumpsys meminfo welab.bank.mobile.stage
查看APP CPU;adb shell dumpsyscpuinfo welab.bank.mobile.stage
单独查看一个APP: adb shell dumpsy scpuinfo welab.bank.mobile.stage | findstr welab.bank.mobile.stage
adb shell top -m -s | findstr packageName
adb shell top
adb shell top -m 5
adb shell top -m 5 -n3
adb shell top -m 5 -n3 -s10
adb shell top -m 5 -n3 -s10 -d10
adb shell top -n3 -s10 -d10 | findstr welab.bank.mob*
adb shell top -n10 -d2 -s9 |findstr welab.bank.mo* >D:\log.txt
查看APP FPS流畅度: adb shell dumpsys gfxinfo welab.bank.mobile.stage
monkey 性能测试: adb shell monkey -p welab.bank.mobile.stage -v -v -v 100
将log保存至本地文件:adb shell monkey -p welab.bank.mobile.stage -v -v -v 500 > D:/monkey.txt
adb shell 进入手机内部
从手机获取文件:adb pull 文件在手机的绝对路径 本地路径