码迷,mamicode.com
首页 > 其他好文 > 详细

Monkey的基本操作

时间:2018-04-30 17:54:13      阅读:125      评论:0      收藏:0      [点我收藏+]

标签:包名   shel   ack   menu   操作   比例   cat   ttl   指定   

adb devices                           --查看是否连接手机
adb shell monkey 101                        --随机101个事件
adb logcat | grep START                      --查看手机安装的包名(cmp=这里是包名)
adb shell monkey -p com.android.calculator2 101           --指定对某个应用操作
adb shell monkey -p com.android.calculator2 --throttle 毫秒 101    --事件之间间隔时间
adb shell monkey -p com.android.calculator2 -s 100 101       --加上s参数执行,下次只要用同样的参数值就能执行同样的操作,方便重现
adb shell monkey -p com.android.calculator2 --pct-touch 100 101   --(--pct-touch 100 百分百为点击事件,)也就是101次点击事件
adb shell monkey -v -p com.android.calculator2 --pct-touch 100 101
--加上-V 会看到执行了哪些操作

monkey的常用事件

  • --pct-touch <percent>:指定触摸事件的百分比。
  • --pct-motion <percent>:指定滑动事件的百分比。
  • --pct-trackball <percent>:指定轨迹球事件的百分比。
  • --pct-nav <percent>:指定导航事件中,up、down、left、right等事件的百分比。
  • --pct-majornav <percent>:指定导航事件中,back、menu等事件的百分比。
  • --pct-syskeys <percent>:指定系统按键的百分比,包括HOME、Back、音量等。
  • --pct-appswitch <percent>:指定Activity之间切换的比例。
  • --pct-anyevent <percent>:指定任意事件的百分比。

Monkey的基本操作

标签:包名   shel   ack   menu   操作   比例   cat   ttl   指定   

原文地址:https://www.cnblogs.com/BlueSkyWhiteClouds/p/8973974.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!