我也补充下黑白名单以及一些长时间跑的例子,很多都是之前的笔记,摘录于网上:
白名单和黑名单
- 白名单:只测试部分应用( -p 的作用一样)但是如果-p 的程序过多就需要用到白名单了
- 黑名单:不测试的应用
--pkg-blacklist-file 后面跟的是文件的路径
--pkg-whitelist-file 后面跟的是文件的路径
可以自定义设置目录 /data/local/tmp/
在 d:\writelist.txt 中设置白名单格式如下:
com.pageage.test
......
adb push d:\whitelist.txt /data/local/tmp/
adb shell monkey -- pkg-whitelist-file /data/local/tmp/whitelist.txt --throttle 200 300
这个命令的意思就是 只跑白名单里面的应用,延迟 200 毫秒 执行 300 次,黑名单的执行方法和白名单一样
其他实例
monkey --throttle 1000 --ignore-crashes --ignore-timeouts --ignore-security-exceptions --ignore-native-crashes --monitor-native-crashes -s 1000 -v -v -v 30000 1 >> /mnt/sdcard/Stability_base.txt 2>> /mnt/sdcard/Stability_base_err.txt
monkey --pkg-whitelist-file /mnt/sdcard/whitelist.txt --throttle 1000 --ignore-crashes --ignore-timeouts --ignore-security-exceptions --ignore-native-crashes --monitor-native-crashes -s 1000 -v -v -v 90000 1 >> /mnt/sdcard/Stability_base.txt 2>> /mnt/sdcard/Stability_base_err.txt
monkey --pkg-whitelist-file /mnt/sdcard/whitelist.txt --throttle 1000 --ignore-crashes --ignore-timeouts --ignore-security-exceptions --ignore-native-crashes --monitor-native-crashes -s 1000 -v -v -v 30000 1 >> /mnt/sdcard/Stability_base.txt 2>> /mnt/sdcard/Stability_base_err.txt
monkey --throttle 1000 --ignore-crashes --ignore-timeouts --ignore-security-exceptions --ignore-native-crashes --monitor-native-crashes -s 1000 -v -v -v 180000 1 >> /mnt/sdcard/Stability_base.txt 2>> /mnt/sdcard/Stability_base_err.txt
- 跑 ALL APK 命令(>12 小时)加入黑名单:
monkey --pkg-blacklist-file /mnt/sdcard/blacklist.txt --throttle 1000 --ignore-crashes --ignore-timeouts --ignore-security-exceptions --ignore-native-crashes --monitor-native-crashes -s 1000 -v -v -v 180000 1 >> /mnt/sdcard/Stability_base.txt 2>> /mnt/sdcard/Stability_base_err.txt
monkey --pkg-whitelist-file /mnt/sdcard/whitelist.txt --throttle 1000 --ignore-crashes --ignore-timeouts --ignore-security-exceptions --ignore-native-crashes --monitor-native-crashes -s 1000 -v -v -v 180000 1 >> /mnt/sdcard/Stability_base.txt 2>> /mnt/sdcard/Stability_base_err.txt
-
跑 ALL APK 命令(>24 小时):
monkey --throttle 1000 --ignore-crashes --ignore-timeouts --ignore-security-exceptions --ignore-native-crashes --monitor-native-crashes -s 1000 -v -v -v 360000 1 >> /mnt/sdcard/Stability_base.txt 2>> /mnt/sdcard/Stability_base_err.txt
跑 ALL APK 命令(>24 小时)加入黑名单:
monkey --pkg-blacklist-file /mnt/sdcard/blacklist.txt --throttle 1000 --ignore-crashes --ignore-timeouts --ignore-security-exceptions --ignore-native-crashes --monitor-native-crashes -s 1000 -v -v -v 360000 1 >> /mnt/sdcard/Stability_base.txt 2>> /mnt/sdcard/Stability_base_err.txt
monkey --pkg-whitelist-file /mnt/sdcard/whitelist.txt --throttle 1000 --ignore-crashes --ignore-timeouts --ignore-security-exceptions --ignore-native-crashes --monitor-native-crashes -s 1000 -v -v -v 360000 1 >> /mnt/sdcard/Stability_base.txt 2>> /mnt/sdcard/Stability_base_err.txt