当前位置:   article > 正文

APP稳定性测试工具monkey_got ioexception performing flipjava.io.filenotfoun

got ioexception performing flipjava.io.filenotfoundexception: /dev/input/eve

monkey简介

monkey是一款APP的自动化测试工具,monkey是猴子的意思,所以从原理上说,它的自动化测试就类似猴子一样在软件上乱敲按键,猴子什么都不懂,就爱搞乱,monkey原理也是类似,通过向系统发送伪随机的用户事件流(如按键输入、触摸屏输入,滑动trackball、手势输入操作等),来对设备上的程序进行测试,检测程序长时间的稳定性,多长时间会发生异常。

monkey工具存在Android系统中,使用Java语言写成,jar包在Android文件系统中存放的路径是:/system/framework/monkey.jar;monkey.jar程序是由一个名为“monkey”的shell脚本来启动执行,shell脚本在Android文件系统的存放路径是:/system/bin/monkey;

monkey需要通过adb来唤醒,即通过在cmd窗口中执行:adb shell monkey {+命令参数}来进行monkey测试。

 

1、连接手机(Android)(这样子就是连接成功了)(前提是连接手机线且运行访问)

2、获取APP的包名

2.1在通过monkey进行测试前,需要知道待测试APP的包名,可以通过使用“uiautomatorviewer.bat”工具来获取,也可以直接询问提供app的开发小哥哥,或者直接使用adb命令获取包名。

2.2以下简单介绍两种通过adb命令获取包名的方法

方法一:cmd状态下:adb shell dumpysys activity | findstr mFocusedActivity

或者进入shell状态下查看

adb shell dumpysys activity | findstr mFocusedActivity

通过启动APP,获取包名(微博为例子)

             1.启动APP软件;

              2.使用adb shell dumpsys window | findstr mCurrentFocus命令,查看所有启动中的应用程序

 

 

3.monkey基本参数

3.1monkey命令参数大致分为三大类:

1)基本配置参数 -v            -s     - -throttle(事件间隔之间)         -p

2)发送的事件类型

3)调试选项

3.2-p参数,指定要测试的包名:

1)//指定1个包

eg:adb shell monkey -p com.sina.weibo 200(以微博为例子)

2)//指定多个包名//

比如两个包名的情况下:adb shell monkey -p com.sina.weibo -p com taobao,taobao 1000

-p后面接app包名,2000是要测试的操作的次数,(即随机事件数),比如点击,缩放数等,达到这个次数测试就结束退出monkey测试状态

3)//不指定包

adb shell monkey 100

说明:monkey随机启动app并发送100个随机事件

3.3-v参数

1)-v参数,指定输出日志的级别,monkey输出日志由3个级别,通过-v参数来指定;

2)-v 第一级别;   -v -v第二级别;  -v-v-v第三级别

3)eg://指定日志级别leve10

adb shell monkey -p com.sina.weibo -v 100

说明:日志级别10:缺省略,仅提供启动提示,测试完成和最终结果等少量信息

4)//指定日志级别level1

adb shell monkey -p com.sina.weibo -v -v 100

例如:adb shell monkey -p com.sina.weibo -v -v 100
  bash arg: -p
  bash arg: com.sina.weibo
  bash arg: -v
  bash arg: -v
  bash arg: 100
args: [-p, com.sina.weibo, -v, -v, 100]
 arg: "-p"
 arg: "com.sina.weibo"
 arg: "-v"
 arg: "-v"
 arg: "100"
data="com.sina.weibo"
:Monkey: seed=1620415837027 count=100
:AllowPackage: com.sina.weibo
:IncludeCategory: android.intent.category.LAUNCHER
:IncludeCategory: android.intent.category.MONKEY
// Selecting main activities from category android.intent.category.LAUNCHER
//   + Using main activity com.sina.weibo.SplashActivity (from package com.sina.weibo)
// Selecting main activities from category android.intent.category.MONKEY
// Seeded: 1620415837027
// Event percentages:
//   0: 15.0%
//   1: 10.0%
//   2: 2.0%
//   3: 15.0%
//   4: -0.0%
//   5: -0.0%
//   6: 25.0%
//   7: 15.0%
//   8: 2.0%
//   9: 2.0%
//   10: 1.0%
//   11: 13.0%
:Switch: #Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=com.sina.weibo/.SplashActivity;end
    // Allowing start of Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.sina.weibo/.SplashActivity } in package com.sina.weibo
Sleeping for 0 milliseconds
:Switch: #Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=com.sina.weibo/.SplashActivity;end
    // Allowing start of Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.sina.weibo/.SplashActivity } in package com.sina.weibo
Sleeping for 0 milliseconds
:Sending Touch (ACTION_DOWN): 0:(983.0,879.0)
:Sending Touch (ACTION_UP): 0:(982.7016,890.76385)
Sleeping for 0 milliseconds
:Sending Key (ACTION_DOWN): 200    // KEYCODE_BUTTON_13
:Sending Key (ACTION_UP): 200    // KEYCODE_BUTTON_13
Sleeping for 0 milliseconds
:Sending Touch (ACTION_DOWN): 0:(212.0,602.0)
:Sending Touch (ACTION_UP): 0:(212.64648,598.44543)
Sleeping for 0 milliseconds
:Sending Key (ACTION_DOWN): 115    // KEYCODE_CAPS_LOCK
:Sending Key (ACTION_UP): 115    // KEYCODE_CAPS_LOCK
Sleeping for 0 milliseconds
:Sending Trackball (ACTION_MOVE): 0:(-5.0,2.0)
:Sending Trackball (ACTION_MOVE): 0:(-4.0,4.0)
:Sending Trackball (ACTION_MOVE): 0:(2.0,0.0)
:Sending Trackball (ACTION_MOVE): 0:(3.0,3.0)
:Sending Trackball (ACTION_MOVE): 0:(-2.0,2.0)
:Sending Trackball (ACTION_MOVE): 0:(-1.0,3.0)
:Sending Trackball (ACTION_MOVE): 0:(0.0,2.0)
:Sending Trackball (ACTION_MOVE): 0:(0.0,-3.0)
:Sending Trackball (ACTION_MOVE): 0:(3.0,-4.0)
:Sending Trackball (ACTION_MOVE): 0:(4.0,1.0)
:Sending Key (ACTION_DOWN): 20    // KEYCODE_DPAD_DOWN
:Sending Key (ACTION_UP): 20    // KEYCODE_DPAD_DOWN
Sleeping for 0 milliseconds
:Sending Trackball (ACTION_MOVE): 0:(3.0,2.0)
:Sending Trackball (ACTION_MOVE): 0:(-2.0,1.0)
:Sending Trackball (ACTION_MOVE): 0:(-5.0,-4.0)
:Sending Trackball (ACTION_MOVE): 0:(0.0,0.0)
:Sending Trackball (ACTION_MOVE): 0:(2.0,0.0)
:Sending Trackball (ACTION_MOVE): 0:(-5.0,-4.0)
:Sending Trackball (ACTION_MOVE): 0:(4.0,1.0)
:Sending Trackball (ACTION_MOVE): 0:(-2.0,1.0)
:Sending Trackball (ACTION_MOVE): 0:(-2.0,-4.0)
:Sending Trackball (ACTION_MOVE): 0:(2.0,0.0)
:Sending Key (ACTION_DOWN): 20    // KEYCODE_DPAD_DOWN
:Sending Key (ACTION_UP): 20    // KEYCODE_DPAD_DOWN
Sleeping for 0 milliseconds
:Sending Trackball (ACTION_MOVE): 0:(3.0,2.0)
:Sending Trackball (ACTION_MOVE): 0:(3.0,3.0)
:Sending Trackball (ACTION_MOVE): 0:(-1.0,2.0)
:Sending Trackball (ACTION_MOVE): 0:(4.0,-1.0)
:Sending Trackball (ACTION_MOVE): 0:(0.0,-4.0)
:Sending Trackball (ACTION_MOVE): 0:(-3.0,2.0)
:Sending Trackball (ACTION_MOVE): 0:(-1.0,-4.0)
:Sending Trackball (ACTION_MOVE): 0:(-3.0,-2.0)
:Sending Trackball (ACTION_MOVE): 0:(-5.0,2.0)
:Sending Trackball (ACTION_MOVE): 0:(3.0,1.0)
:Sending Touch (ACTION_DOWN): 0:(770.0,876.0)
:Sending Touch (ACTION_MOVE): 0:(768.5238,884.5332)
:Sending Touch (ACTION_MOVE): 0:(766.7963,889.57544)
:Sending Touch (ACTION_MOVE): 0:(763.0123,891.008)
:Sending Touch (ACTION_MOVE): 0:(759.6622,902.1745)
:Sending Touch (ACTION_MOVE): 0:(757.3516,905.6123)
:Sending Touch (ACTION_UP): 0:(753.77527,917.2194)
Sleeping for 0 milliseconds
:Sending Key (ACTION_DOWN): 82    // KEYCODE_MENU
:Sending Key (ACTION_UP): 82    // KEYCODE_MENU
Sleeping for 0 milliseconds
:Sending Touch (ACTION_DOWN): 0:(214.0,1414.0)
:Sending Touch (ACTION_MOVE): 0:(215.72974,1424.9598)
:Sending Touch (ACTION_MOVE): 0:(216.36249,1447.3866)
:Sending Touch (ACTION_MOVE): 0:(227.43822,1468.0859)
:Sending Touch (ACTION_MOVE): 0:(234.65425,1476.5271)
:Sending Touch (ACTION_MOVE): 0:(235.37877,1486.8446)
:Sending Touch (ACTION_MOVE): 0:(243.15639,1487.3157)
:Sending Touch (ACTION_MOVE): 0:(247.53148,1490.2711)
:Sending Touch (ACTION_MOVE): 0:(260.01468,1491.5018)
:Sending Touch (ACTION_UP): 0:(273.03467,1510.265)
Sleeping for 0 milliseconds
:Sending Key (ACTION_DOWN): 108    // KEYCODE_BUTTON_START
:Sending Key (ACTION_UP): 108    // KEYCODE_BUTTON_START
Sleeping for 0 milliseconds
:Sending Key (ACTION_DOWN): 21    // KEYCODE_DPAD_LEFT
:Sending Key (ACTION_UP): 21    // KEYCODE_DPAD_LEFT
Sleeping for 0 milliseconds
:Sending Trackball (ACTION_MOVE): 0:(3.0,-3.0)
:Sending Trackball (ACTION_MOVE): 0:(-4.0,0.0)
:Sending Trackball (ACTION_MOVE): 0:(3.0,2.0)
:Sending Trackball (ACTION_MOVE): 0:(2.0,-5.0)
:Sending Trackball (ACTION_MOVE): 0:(3.0,2.0)
:Sending Trackball (ACTION_MOVE): 0:(0.0,-5.0)
:Sending Trackball (ACTION_MOVE): 0:(0.0,-1.0)
:Sending Trackball (ACTION_MOVE): 0:(-1.0,1.0)
:Sending Trackball (ACTION_MOVE): 0:(-5.0,0.0)
:Sending Trackball (ACTION_MOVE): 0:(-4.0,-5.0)
:Sending Trackball (ACTION_MOVE): 0:(4.0,2.0)
:Sending Trackball (ACTION_MOVE): 0:(1.0,-5.0)
:Sending Trackball (ACTION_MOVE): 0:(1.0,-5.0)
:Sending Trackball (ACTION_MOVE): 0:(0.0,-2.0)
:Sending Trackball (ACTION_MOVE): 0:(-1.0,1.0)
:Sending Trackball (ACTION_MOVE): 0:(-5.0,-2.0)
:Sending Trackball (ACTION_MOVE): 0:(-5.0,-3.0)
:Sending Trackball (ACTION_MOVE): 0:(-5.0,2.0)
:Sending Trackball (ACTION_MOVE): 0:(0.0,2.0)
:Sending Trackball (ACTION_MOVE): 0:(1.0,4.0)
:Sending Touch (ACTION_DOWN): 0:(469.0,2268.0)
:Sending Touch (ACTION_UP): 0:(463.07028,2269.2312)
Sleeping for 0 milliseconds
:Sending Key (ACTION_DOWN): 193    // KEYCODE_BUTTON_6
:Sending Key (ACTION_UP): 193    // KEYCODE_BUTTON_6
Sleeping for 0 milliseconds
:Sending Key (ACTION_DOWN): 22    // KEYCODE_DPAD_RIGHT
:Sending Key (ACTION_UP): 22    // KEYCODE_DPAD_RIGHT
Sleeping for 0 milliseconds
:Sending Key (ACTION_DOWN): 24    // KEYCODE_VOLUME_UP
:Sending Key (ACTION_UP): 24    // KEYCODE_VOLUME_UP
Sleeping for 0 milliseconds
:Sending Trackball (ACTION_MOVE): 0:(-3.0,0.0)
:Sending Trackball (ACTION_MOVE): 0:(-2.0,2.0)
:Sending Trackball (ACTION_MOVE): 0:(-4.0,2.0)
:Sending Trackball (ACTION_MOVE): 0:(-1.0,-4.0)
:Sending Trackball (ACTION_MOVE): 0:(3.0,-1.0)
Events injected: 100
:Sending rotation degree=0, persist=false
:Dropped: keys=0 pointers=0 trackballs=0 flips=0 rotations=0
## Network stats: elapsed time=578ms (0ms mobile, 0ms wifi, 578ms not connected)
// Monkey finished

说明:日志级别level1,提供较为详细的日志,包括每个发送到activity的信息

5)//指定日志级别level 2

adb shell monkey -p com.sina.weibo -v -v -v100

说明:日志级别level2,提供更详细的日志,包括了测试选中/未选中的activity信息

 

3.3 -throttle参数,指定用户操作间的时延

1)//指定用户操作(即事件)间的时延

adb shell monkey -p com.sina.weibo --throttle 3000 100

C:\Users\AOC>adb shell monkey -p com.sina.weibo --throttle 30 100 >d:\monkey.log
args: [-p, com.sina.weibo, --throttle, 30, 100]
 arg: "-p"
 arg: "com.sina.weibo"
 arg: "--throttle"
 arg: "30"
 arg: "100"
data="com.sina.weibo"
arg="--throttle" mCurArgData="null" mNextArg=3 argwas="--throttle" nextarg="30"
data="30"

说明:throttle单位是毫秒

 

3.4 -s(随机数种子)

用于指定伪随机数生成器的seed值,如果seed值相同,则两次monkey测试所产生的时间序列也相同

monkey测试1:adb shell monkey -p com.sina.weibo -s 10 100

运行的例子:adb shell monkey -p com.sina.weibo -v -v -v --throttle 1000 -s 10 100 >d:\monkey.log

C:\Users\AOC>adb shell monkey -p com.sina.weibo -v -v -v --throttle 1000 -s 10 100 >d:\monkey.log
args: [-p, com.sina.weibo, -v, -v, -v, --throttle, 1000, -s, 10, 100]
 arg: "-p"
 arg: "com.sina.weibo"
 arg: "-v"
 arg: "-v"
 arg: "-v"
 arg: "--throttle"
 arg: "1000"
 arg: "-s"
 arg: "10"
 arg: "100"
data="com.sina.weibo"
arg="--throttle" mCurArgData="null" mNextArg=6 argwas="--throttle" nextarg="1000"
data="1000"
data="10"

monkey测试2:adb shell monkey -p com.sina.weibo -s 10 100

运行的例子:adb shell monkey -p com.sina.weibo -v -v -v --throttle 1000 -s 10 100 >d:\monkey.log1

adb shell monkey -p com.sina.weibo -v -v -v --throttle 1000 -s 10 100 >d:\monkey.log1
args: [-p, com.sina.weibo, -v, -v, -v, --throttle, 1000, -s, 10, 100]
 arg: "-p"
 arg: "com.sina.weibo"
 arg: "-v"
 arg: "-v"
 arg: "-v"
 arg: "--throttle"
 arg: "1000"
 arg: "-s"
 arg: "10"
 arg: "100"
data="com.sina.weibo"
arg="--throttle" mCurArgData="null" mNextArg=6 argwas="--throttle" nextarg="1000"
data="1000"
data="10"

这个参数对于重测,复现问题比较常用

3.5 事件类型参数

monkey的事件类型总共有11种,分别是触摸(Touch)、手势(motion)、二指缩放(pinchzoom)、轨迹(trackball)、旋转(rotation)、基本导航(nav)、主要导航事件(majornav)、系统按键(syskeys)、启动 activity(appswitch)、键盘事件(flip)和其它类型事件(anyevent),在日志中分别用0-10来表示;

如:

 

3.6 调试选项参数

由于monkey在测试app时,我们需要作长时间的稳定性测试,比如连续测试10小时(monkey不能指定事件,可以指定次数,事件可以在测试次数的日志基础上大概算出来,)在测试过程中,app很可能时间不久,因为碰到问题而崩溃,此时测试会停止,而达不到我们长期测试的目的,我们需要通过调试参数来让测试执行继续,主要的几个参数如下:

--ignore-crashes 指即使程序崩溃(Fore &close错误),monkey依然会发送事件,直到事件计数达到指定的次数为止。

eg:adb shell monkey -p com.sina.weibo --ignore-crashes 1000

说明:即使应用程序崩溃,monkey依然会发送事件,直到事件计数达到1000为止

C:\Users\AOC>adb shell monkey -p com.sina.weibo --ignore-crashes 1000
  bash arg: -p
  bash arg: com.sina.weibo
  bash arg: --ignore-crashes
  bash arg: 1000
args: [-p, com.sina.weibo, --ignore-crashes, 1000]
 arg: "-p"
 arg: "com.sina.weibo"
 arg: "--ignore-crashes"
 arg: "1000"
data="com.sina.weibo"
arg="--ignore-crashes" mCurArgData="null" mNextArg=3 argwas="--ignore-crashes" nextarg="1000"
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
    // Injection Failed
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
Events injected: 1000
## Network stats: elapsed time=2249ms (0ms mobile, 0ms wifi, 2249ms not connected)

3.7 --ignore-security-exceptions 指APP发生许可证数错误时,monkey依然继续发送事件,直到事件数目达到目标值为止

eg:adb shell monkey -p com.sina.weibo --ignore-security-exceptions 1000

3.8 --ignore-timeouts指APP在发生ANR(Application No Responding)错误时,monkey是否停止运行如果使用--ignore-timeouts参数,即使应用程序发生ANR错误,monkey依然会发送事件,直到事件计数完成。

eg:adb shell monkey - p com.sina.weibo --ignore-timeouts 1000

3.9 --kill-process-after-erroor 指APP发生错误时,应用程序停止运行并保持在当前状。

eg: adb shell monkey -p com.sina.weibo --kill-process-after-error 1000

当应用程序发生错误时,应用程序停止运行并保持在当前状态,注意系统并不会结束该应用程序的进程。

也多个控制参数一起使用

adb shell monkey -p com.sina.weibo --ignore-crashes --ignore-timeouts 10000

注:当APP崩溃,发生ANR错误时继续测试

C:\Users\AOC>adb shell monkey -p com.sina.weibo --ignore-crashes --ignore-timeouts 10000

实例子:
C:\Users\AOC>adb shell monkey -p com.sina.weibo --ignore-crashes --ignore-timeouts 10000
  bash arg: -p
  bash arg: com.sina.weibo
  bash arg: --ignore-crashes
  bash arg: --ignore-timeouts
  bash arg: 10000
args: [-p, com.sina.weibo, --ignore-crashes, --ignore-timeouts, 10000]
 arg: "-p"
 arg: "com.sina.weibo"
 arg: "--ignore-crashes"
 arg: "--ignore-timeouts"
 arg: "10000"
data="com.sina.weibo"
arg="--ignore-crashes" mCurArgData="null" mNextArg=3 argwas="--ignore-crashes" nextarg="--ignore-timeouts"
arg="--ignore-timeouts" mCurArgData="null" mNextArg=4 argwas="--ignore-timeouts" nextarg="10000"
    // activityResuming(com.sina.weibo)
    // activityResuming(com.sina.weibo)
    // activityResuming(com.bbk.launcher2)
    // Injection Failed
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
    // activityResuming(com.sina.weibo)
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
    // activityResuming(com.bbk.launcher2)
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
    // activityResuming(com.sina.weibo)
    // activityResuming(com.bbk.launcher2)
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
    // Injection Failed
    // activityResuming(com.sina.weibo)
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
    // activityResuming(com.sina.weibo)
    // activityResuming(com.sina.weibo)
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // activityResuming(com.bbk.launcher2)
    // Injection Failed
    // activityResuming(com.sina.weibo)
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
    // Injection Failed
    // activityResuming(com.sina.weibo)
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // activityResuming(com.bbk.launcher2)
    // activityResuming(com.sina.weibo)
    // activityResuming(com.bbk.launcher2)
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
    // Injection Failed
    // activityResuming(com.sina.weibo)
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
    // Injection Failed
    // activityResuming(com.bbk.launcher2)
    // Injection Failed
    // activityResuming(com.sina.weibo)
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
    // activityResuming(com.bbk.launcher2)
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // activityResuming(com.sina.weibo)
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
    // activityResuming(com.bbk.launcher2)
    // activityResuming(com.sina.weibo)
    // Injection Failed
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
    // activityResuming(com.sina.weibo)
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
    // activityResuming(com.sina.weibo)
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
    // activityResuming(com.sina.weibo)
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
    // Injection Failed
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
    // activityResuming(com.bbk.launcher2)
    // activityResuming(com.sina.weibo)
    // activityResuming(com.bbk.launcher2)
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
    // activityResuming(com.sina.weibo)
    // Injection Failed
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
    // activityResuming(com.bbk.launcher2)
    // activityResuming(com.sina.weibo)
    // Injection Failed
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
    // activityResuming(com.bbk.launcher2)
    // activityResuming(com.vivo.gallery)
    // Injection Failed
    // Injection Failed
    // activityResuming(com.bbk.launcher2)
    // Injection Failed
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
Got IOException performing flipjava.io.FileNotFoundException: /dev/input/event0: open failed: EACCES (Permission denied)
    // Injection Failed
    // activityResuming(com.sina.weibo)
    // activityResuming(com.sina.weibo)
Events injected: 10000
## Network stats: elapsed time=30173ms (0ms mobile, 0ms wifi, 30173ms not connected)

 

 

4.存放日志的路径

输入命令:adb shell monkey -p com.sina.weibo -v -v 100 >d:\monkey.log(注:记得每次运行完一个命令,可以先删除日志再运行)

5、monkey命令和事件等综合运用参考

eg:adb shell monkey -p com.sina.weibo --throttle 500 --ignore-crashes --ignore-timeouts --ignore-security-exception --ignore-native-crashes --monitor-native-crashes -v -v -v100000 >d:\monkeylog.log

6、monkey测试可以发现的问题

Android平台应用程序可能产生以下四种crash:

6.1app层(java 应用程序):

1)Fore close crash

2)ANR Crash

6.2 Native 层(本地框架)

1)Tombstone Crash(Native Crash)

6.3 Kernel Panic

 

 

 

 

 

 

 

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/221527
推荐阅读
相关标签
  

闽ICP备14008679号