msk*_*msk 7 android android-monkey
我正在使用monkey命令对我的应用程序进行压力测试.但是我希望在屏幕方向上更多地测试它,以便在改变方向时检测并捕获一些堆积更新.我在android官方网站上搜索了关于猴子命令/参数的信息,这些命令/参数将在任何app/activity上运行时进行屏幕方向.但没有运气,想过要问像你这样的专业人士.
如果有这个想法,请告诉我.
小智 10
Monkey有许多未记载的选项,包括--pct-rotation.将该开关添加到您的命令,并观看您的屏幕像恶魔所拥有的那样旋转:
最高(包括)adb版本1.0.31:
adb shell monkey -p com.example.app -v --pct-rotation=70 500
Run Code Online (Sandbox Code Playgroud)
自adb版本1.0.32:
adb shell monkey -p com.example.app -v --pct-rotation 70 500
Run Code Online (Sandbox Code Playgroud)
查看monkey命令的processOptions()方法以查看所有支持的选项:https://android.googlesource.com/platform/development.git/+/master/cmds/monkey/src/com/android/commands /monkey/Monkey.java
查看MonkeySourceRandom类的构造函数,以查看所有事件类型的默认百分比.这些是本文发布时主分支中的当前值.请注意,旋转的默认值为0:
// default values for random distributions
// note, these are straight percentages, to match user input (cmd line args)
// but they will be converted to 0..1 values before the main loop runs.
mFactors[FACTOR_TOUCH] = 15.0f;
mFactors[FACTOR_MOTION] = 10.0f;
mFactors[FACTOR_TRACKBALL] = 15.0f;
// Adjust the values if we want to enable rotation by default.
mFactors[FACTOR_ROTATION] = 0.0f;
mFactors[FACTOR_NAV] = 25.0f;
mFactors[FACTOR_MAJORNAV] = 15.0f;
mFactors[FACTOR_SYSOPS] = 2.0f;
mFactors[FACTOR_APPSWITCH] = 2.0f;
mFactors[FACTOR_FLIP] = 1.0f;
mFactors[FACTOR_ANYTHING] = 13.0f;
mFactors[FACTOR_PINCHZOOM] = 2.0f;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1521 次 |
| 最近记录: |