Monkey环境搭建
Android使用模拟器
IOS使用Xcode
#使用devices检测手机是否连接正常
adb devices
#安装APK到手机
adb install "地址".apk
#覆盖安装
adb install -r "地址".apk
#卸载指定APP
adb shell pm uninstall -k "包名"
#这个程序包单独进行500次的monkey测试
adb shell monkey –p "包名" –v 500
# 忽略崩溃
adb shell monkey --ignore-crashes 1000
#忽略超时
adb shell monkey --ignore-timeouts 1000
#指定事件延迟1000ms
adb shell monkey --throttle 1000 1000
#指定触摸事件百分比10%
adb shell monkey --pct-touch 10 1000
#手势事件
–pct-motion
#触摸事件
–pct-touch
#二指缩放事件
–pct-pinchzoom
#app切换
pct-appswitch