主要记录下在做appium时需要用到一些常用命令,包括monkey test与安卓抓包
1.查看手机是否连接:
adb devices
2.查看手机安装的所有包 :
adb shell pm list packages
3.按照条件查找安装包:
adb shell "pm list packages | grep 条件"
比如查找包名含有io.appium.uiautomator2.server的安装包:adb shell "pm list packages | grep io.appium.uiautomator2.server"
4.查看appPackage 与appActivity(前提是你已经SDK环境配置好了)
aapt dump badging [yourapp.apk]
5.APK安装:
adb install APK路径
6.APK卸载:
adb uninstall 包名
7.安卓抓包:
adb logcat | find "APK包名" >d:\log.txt
比如我要抓淘宝的log,并将抓到信息(自己命名为log,也可以命名其他的)保存在d盘
那个CC是Ctrl+C停止抓log
8.monkey test
monkey测试就是一行命令,主要是测试APK的健壮性
将淘宝按照种子时间是153执行monkey10000次并保存在D盘
adb shell monkey -v -v --ignore-crashes --ignore-timeouts --kill-process-after-error -p com.taobao.taobao --throttle 500 -s 153 10000 >D:\monkey.txt
附上一份非常详细的monkey参数解释:https://blog.csdn.net/cxq234843654/article/details/47153345