Pre-preparation:
adb: used to connect Android phones and PC side of the bridge, have adb as to maintain between the two, in order to fully operate the phone in your computer. (Adb push path to the file path adb pull the phone from the phone to the computer pull)
monkey need to install it?
1, the adb computer installation, the command line command monkey
2, android comes with the monkey, so Android phones are no longer installed
monkey use scenarios:
And other products is stable, not particularly large bug when testing applications typically use monkey stability, robustness (whether or flash back may occur, crash); testing machine
monkey commonly used commands:
First: -p: Specifies the run registration such as: adb shell monkey -p con.lenmon.cn
To run two packages at the same time, the use of two first package name -p -p -p second package name
Second: -s setting seed number ( 相当于设置一个路径,因为monkey是
random event, so in order to return to the path of consensus on the need to set the same seed value )
Namely: first set -S 10 (Click> Flip> Click to navigate appeared ANR), the second recurring time, only need to set the same -s 10
Main functions: to reproduce the problem adb shell monkey
100
-
s
5
Third: -v Set the log up to the level (-v: simpler log -vv more content log log -vvv most complete) used three -v
Fourth: - throllte delay before the two spaced understood to operate Time
Within a specified time frame, the random delay -randomize
-
throttle,例如:要设置在5s内随机延时:--throllte 5000 --randomize--throllte
Fifth: white list --pkg-whitelist-file: perform only whitelist file inside the package / apk adb shell monkey --pkg-whitelist-file /data/local/tmp/whitelist.txt
Blacklist --pkg-blacklist-file: blacklist file is not performed inside the package / apk adb shell monkey --pkg-blacklist-file /data/local/tmp/blacklist.txt
Sixth: Ignore command
--ignore-crash: Ignore Ben collapse
--ignore-timeout timeout ignored
--ignore-security-expections: Ignore license plus three suggestions
seventh:设置事件百分比,所有的百分比加起来不能超过
100
%
0
:触摸事件百分比,即参数
-
-
pct
-
touch
1
:滑动事件百分比,即参数
-
-
pct
-
motion
2
:缩放事件百分比,即参数
-
-
pct
-
pinchzoom
3
:轨迹球事件百分比,即参数
-
-
pct
-
trackball
4
:屏幕旋转事件百分比,即参数
-
-
pct
-
rotation
5
:基本导航事件百分比,即参数
-
-
pct
-
nav
6
:主要导航事件百分比,即参数
-
-
pct
-
majornav
7
:系统事件百分比,即参数
-
-
pct
-
syskeys
8
:Activity启动事件百分比,即参数
-
-
pct
-
appswitch
9
:键盘翻转事件百分比,即参数
-
-
pct
-
flip
10
:其他事件百分比,即参数
-
-
pct
-
anyevent
例:adb shell monkey
-
-
pct
-
touch
20
-
v
100