Android测试笔记

Monkey基本命令

2017-06-16  本文已影响3人  西风兔

拿走不谢,改包名后直接运行

adb shell monkey -p com.xxx --pct-touch 40 --pct-motion 25 --pct-appswitch 10 --pct-rotation 5 -s 9527 --throttle 400 --ignore-crashes --ignore-timeouts -v-v 500000

逐个说明

在包名为com.xxx的App内执行5000次操作
adb shell monkey -p com.xxx 5000
伪随机数种子值为9527
 adb shell monkey -p com.xxx -s 9527 5000
两次操作的间隔为100毫秒
 adb shell monkey -p com.xxx --throttle 100 5000
触摸操作的占比为40%
 adb shell monkey -p com.xxx --pct-touch 40 5000
启动Activity占比为10%
adb shell monkey -p com.xxx -pct-appswitch 10 5000
日志反馈信息级别为Level2
adb shell monkey -p com.xxx  -v-v-v 5000
Crash后继续测试
adb shell monkey -p com.cetc22.clw.jryg --ignore-crashes  5000
ANR后继续测试
adb shell monkey -p com.cetc22.clw.jryg  --ignore-timeouts 5000
保存日志到D盘
adb shell monkey >d:\monkey.txt
标注流和错误流分开保存到手机
>adb shell 
>monkey 1>/sdcard/monkey.txt 2>/sdcard/error.txt
上一篇下一篇

猜你喜欢

热点阅读