1 部署准备
项目地址
https://github.com/zhangzhao4444/Maxim
https://testerhome.com/topics/11719
https://testerhome.com/topics/11884
部署Maxim
C:\Windows\system32>d:
D:\>cd D:\Study\Maxim
D:\Study\Maxim>git clone https://github.com/zhangzhao4444/Maxim.git
Cloning into 'Maxim'...
remote: Enumerating objects: 211, done.
remote: Total 211 (delta 0), reused 0 (delta 0), pack-reused 211
Receiving objects: 100% (211/211), 6.87 MiB | 720.00 KiB/s, done.
Resolving deltas: 100% (75/75), done.
2 模拟器MuMu启动
C:\Windows\system32>adb devices -l
List of devices attached
127.0.0.1:7555 device product:cancro model:MuMu device:x86 transport_id:1
3 测试
向手机部署Maxim相关
D:\Study\Maxim\Maxim>adb push framework.jar /sdcard
framework.jar: 1 file pushed, 0 skipped. 3.2 MB/s (1149240 bytes in 0.342s)
D:\Study\Maxim\Maxim>adb push monkey.jar /sdcard
monkey.jar: 1 file pushed, 0 skipped. 4.0 MB/s (181012 bytes in 0.043s)
执行
adb shell CLASSPATH=/sdcard/monkey.jar:/sdcard/framework.jar exec app_process /system/bin tv.panda.test.monkey.Monkey -p com.xueqiu.android --uiautomatormix --running-minutes 3
4 帮助
命令行模式
cmd 命令 :
adb shell CLASSPATH=/sdcard/monkey.jar:/sdcard/framework.jar exec app_process /system/bin tv.panda.test.monkey.Monkey -p com.panda.videoliveplatform --uiautomatormix --running-minutes 60 -v -v
- tv.panda.test.monkey.Monkey: monkey入口类,不要修改
- com.panda.videoliveplatform: 被测app包名,需要修改
- –uiautomatormix: 遍历策略
策略
-
模式 DFS
–uiautomatordfs
增加深度遍历算法 -
模式 Mix
–uiautomatormix
直接使用底层accessibiltyserver获取界面接口 解析各控件,随机选取一个控件执行touch操作。
同时与原monkey 其他操作按比例混合使用
默认accessibilityserver action占比50%,其余各action分剩余的50%
accessibilityserver action占比可配置 --pct-uiautomatormix n -
模式Troy
–uiautomatortroy
控件选择策略按max.xpath.selector配置的高低优先级来进行深度遍历 -
保留原始monkey
-
总运行时长
–running-minutes 3 运行3分钟 -
–act-whitelist-file /sdcard/awl.strings 定义白名单
–act-blacklist-file
其他参数与原始monkey一致