1.执行monkey测试
adb shell monkey
2.执行monkey测试100次
adb shell monkey 100
3.用此参数指定一个或多个包。指定包之后,monkey将只允许系统启动指定的app。如果不指定包, monkey将 允许系统启动设备中的所有app。
指定一个包:
adb shell monkey -p 包名 50
adb shell monkey -p com.baidu.searchbox 50
4.显示日志详细程度
adb shell monkey -p 包名 -v 30
adb shell monkey -p com.baidu.searchbox -v 30
5./ / 提 供 较 为 详 细 的 日 志 , 包 括 每 个 发 送 到 A c t i v i t y 的 事 件 信 息
adb shell monkey -p 包名 -v -v 30
adb shell monkey -p baidu.searchbox -v -v 30
6./ / 最 详 细 的 日 志 , 包 括 了 测 试 中 选 中 / 未 选 中 的 A c t i v i t y 信 息
adb shell monkey -p 包名 -v -v -v 30
adb shell monkey -p baidu.searchbox -v -v -v 30
7.将log信息写到本地
adb shell monkey -p -v -v -v com.baidu.searchbox 30 >D:\log\2.txt
8. 用于指定伪随机数生成器的seed值,如果seed相同,则两次Monkey测试所产生的事件序列也相同的。
adb shell monkey -p com.baidu.searchbox -s 10 100
9. --throttle毫秒
adb shell monkey -p com.example.login --throttle 300 100
10. 真机测试
adb devices
抓取日志和日期 adb logcat -v time >D:\log\1.txt