monkey

作者: 44e46f384a16 | 来源:发表于2017-11-08 11:29 被阅读19次

1,adb install xx.apk:把指定的安装包apk文件安装到测试设备中
2,adb shell monkey :给指定的设备发送压力测试,number是要测试的次数。执行这个命令的效果就相当于有个手指在你的手机上乱点。我尝试了10000次,结果费了好一会儿功夫才把手机恢复到我想到的效果。
3,adb shell monkey -p pkgname :同上面效果一样,只是对指定包名(pkgname)apk进行测试。
4,Monkey高级参数的应用
4.1.throttle参数:指定事件之间的间隔时间
adb shell monkey -throttle :milliseconds是时间值 ,单位毫秒
4.2.seed参数:伪随机数生成器的seed 值。
adb shell monkey -s :如果用相同的 seed 值再次运行 Monkey ,它将生成相同的事件序列。
4.3.touch:设置触摸事件
adb shell monkey -pct-touch :指定touch事件的百分比percent
4.4.motion:设置动作事件
adb shell monkey -pct-motion :指定motion事件的百分比percent
4.5.trackball:设置轨迹球事件
adb shell monkey -pct-trackball :指定轨迹球事件百分比percent
4.6.nav:导航事件设置
adb shell monkey -pct-nav :指定基本导航事件百分比percent
4.7.majornav:设置主要导航事件
adb shell monkey -pct-majornav :设定主要导航事件百分比percent,兼容中间键,返回键,菜单按键
4.8.syskeys:设置事件
adb shell monkey -pct-syskeys :设定系统事件百分比percent,比如HOME,BACK,拨号及音量调节等事件。
4.9.appswitch:启动Activity事件
adb shell monkey -pct-appswitch :设定启动activity的事件百分比percent
4.10.anyevent:不常用事件设置
adb shell monkey -pct-anyevent :设定不常用事件地百分比
4.11.crashes :程序崩溃事件设置
adb shell monkey -ignore-crashes :忽略崩溃和异常事件
4.12.timeouts:超时事件设置
adb shell monkey -ignore-timeouts :忽略超时事件

monkey -s 35 -v 1000

相关文章

网友评论

      本文标题:monkey

      本文链接:https://www.haomeiwen.com/subject/tipemxtx.html