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