C:\Users\Administrator>java -version java version "1.8.0_91" Java(TM) SE Runtime Environment (build 1.8.0_91-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode) C:\Users\Administrator>java 用法: java [-options] class [args...] (执行类) 或 java [-options] -jar jarfile [args...] (执行 jar 文件) 其中选项包括: -d32 使用 32 位数据模型 (若是可用) -d64 使用 64 位数据模型 (若是可用) -server 选择 "server" VM 默认 VM 是 server. -cp <目录和 zip/jar 文件的类搜索路径> -classpath <目录和 zip/jar 文件的类搜索路径> 用 ; 分隔的目录, JAR 档案 和 ZIP 档案列表, 用于搜索类文件。 -D<名称>=<值>
C:\Users\Administrator>adb devices List of devices attached emulator-5554 device
C:\Users\Administrator>adb shell root@generic_x86:/ \#
\#monkey -p com.android.email -v 100
其中,-p表示指定一个或者多个包,没有这个参数则不指定包;-v表示指定反馈信息级别,100表示启动该app并发送100个随机事件
root@generic\_x86:/ \# monkey -p com.android.email -v 100 WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix. :Monkey: seed=1518372908154 count=100 :AllowPackage: com.android.email :IncludeCategory: android.intent.category.LAUNCHER :IncludeCategory: android.intent.category.MONKEY // Event percentages: // 0: 15.0% 触摸事件百分比,即参数–pct-touch // 1: 10.0% 滑动事件百分比,即参数–pct-motion // 2: 2.0% 缩放事件百分比,即参数–pct-pinchzoom // 3: 15.0% 轨迹球事件百分比,即参数–pct-trackball // 4: -0.0% 屏幕旋转事件百分比,即参数–pct-rotation // 5: 25.0% 基本导航事件百分比,即参数–pct-nav // 6: 15.0% 主要导航事件百分比,即参数–pct-majornav // 7: 2.0% 系统事件百分比,即参数–pct-syskeys // 8: 2.0% Activity启动事件百分比,即参数–pct-appswitch // 9: 1.0% 键盘翻转事件百分比,即参数–pct-flip // 10: 13.0% 其余事件百分比,即参数–pct-anyevent :Switch: \#Intent;action=android.intent.action.MAIN;category=android.intent.categ ory.LAUNCHER;launchFlags=0x10200000;component=com.android.email/.activity.Welcom e;end // Allowing start of Intent { act=android.intent.action.MAIN cat=[android.in tent.category.LAUNCHER] cmp=com.android.email/.activity.Welcome } in package com .android.email :Sending Touch (ACTION\_DOWN): 0:(176.0,915.0) :Sending Touch (ACTION\_UP): 0:(172.51561,943.72437) :Sending Trackball (ACTION\_MOVE): 0:(-2.0,1.0) // Allowing start of Intent { act=android.intent.action.EDIT dat=content://u i.email.android.com/settings cmp=com.android.email/.activity.setup.AccountSettin gs } in package com.android.email // Allowing start of Intent { cmp=com.android.email/.activity.setup.AccountS etupBasics } in package com.android.email // activityResuming(com.android.email) :Sending Touch (ACTION\_DOWN): 0:(559.0,844.0) :Sending Touch (ACTION\_UP): 0:(494.87607,782.93036) :Sending Touch (ACTION\_DOWN): 0:(717.0,136.0) :Sending Touch (ACTION\_UP): 0:(705.3432,121.778885) :Sending Trackball (ACTION\_MOVE): 0:(-4.0,4.0) :Sending Touch (ACTION\_DOWN): 0:(658.0,1007.0) :Sending Touch (ACTION\_UP): 0:(638.68384,998.59467) :Sending Touch (ACTION\_DOWN): 0:(443.0,542.0) :Sending Touch (ACTION\_UP): 0:(419.82828,558.96) :Sending Touch (ACTION\_DOWN): 0:(280.0,666.0) :Sending Touch (ACTION\_UP): 0:(275.95532,654.7703) :Sending Touch (ACTION\_DOWN): 0:(18.0,979.0) :Sending Touch (ACTION\_UP): 0:(14.776767,980.841) :Sending Trackball (ACTION\_MOVE): 0:(0.0,-3.0) :Sending Touch (ACTION\_DOWN): 0:(253.0,1043.0) :Sending Touch (ACTION\_UP): 0:(255.71083,1034.4076) :Sending Trackball (ACTION_MOVE): 0:(2.0,3.0) :Sending Trackball (ACTION\_UP): 0:(0.0,0.0) :Sending Touch (ACTION\_DOWN): 0:(388.0,699.0) :Sending Touch (ACTION\_UP): 0:(396.3903,699.357) :Sending Trackball (ACTION\_MOVE): 0:(0.0,-1.0) Events injected: 100 :Sending rotation degree=0, persist=false :Dropped: keys=0 pointers=5 trackballs=0 flips=0 rotations=0 \## Network stats: elapsed time=2857ms (0ms mobile, 0ms wifi, 2857ms not connected) // Monkey finished
注意seed值
:Monkey: seed=1518372908154 count=100 没有指定seed值是,会随机生成,能够经过设定seed值使得测试产生的随机操做序列彻底相同java
查找有无日志中的无响应问题和崩溃问题android
有这类的状况再进行具体分析shell