monkey android win7安装使用

来源:互联网 发布:centos 7网卡未连接 编辑:程序博客网 时间:2024/06/14 07:11

1、下载安装java
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
测试是否安装成功:cmd中输入java -version看是否有输出版本信息

名称:jdk-8u121-windows-i586.exe

2、下载android SDK exe版本或者免安装(第一次经验下来感觉免安装好点,exe安装过程比较慢)
http://tools.android-studio.org/index.php/sdk

exe名称为:installer_r24.4.1-windows.exe

3、添加环境变量
找到android安装路径
D:\Program Files (x86)\Java\Android\android-sdk
D:\Program Files (x86)\Java\Android\android-sdk\platform-tools
D:\Program Files (x86)\Java\Android\android-sdk\tools

adb logcat | find “START” #windows环境下查询所有正在运行的apk
adb logcat | grep START #linux环境下查询所有正在运行的apk
adb shell monkey 1000 ##对安卓机里所有的应用进行随机1000次点击测试
adb shell monkey -p com.android.browser 1000 ##对某个应用进行测试
adb shell monkey -p com.android.browser –throttle 1000 100 ##throttle延时多久执行多少次
adb shell monkey -s ##指定随机生成数的speed值
eg:adb shell monkey -s 100 50 #seed值是100 先自己定义一个seed值和event数也设置一致,后面monkey跑的动作全和前面手动跑的一样

触摸事件,设置触摸事件百分比
adb shell monkey –pct-touch
eg: adb shell monkey -v -p com.android.calculator2 –pct-touch 100 2000 所有都是点击事件
-v 意思是显示所有动作详情

动作事件,设定动作事件百分比,松起
adb shell monkey –pct-motion
eg:adb shell monkey -v -p com.android.calculator2 –pct-touch 50 –pct-motion 30 100

轨迹球事件,设定轨迹球事件百分比
adb shell monkey –pct-trackball

基本导航事件,设定基本导航事件百分比,输入设备的上下左右
adb shell monkey –pct-nav

主要导航事件,设定主要导航事件百分比,兼容中间键、返回键、菜单按键
adb shell monkey –pct-majornav

系统导航事件,设定系统导航事件百分比,HOME、BACK、拨号及音量键
adb shell monkey –pct-syskeys

启动Activity事件,设定启动Activity的事件百分比
adb shell monkey –pct-appswitch

不常用事件,设定不常用事件的百分比
adb shell monkey –pct-anyevent

崩溃事件,忽略崩溃和异常直到错误数到设定初始值
adb shell monkey –ignore-crashes

超时事件(anr),忽略超时事件
adb shell monkey –ignore-timeouts

0 0
原创粉丝点击