1、monkey命令格式

  直接adb shell进入后输入monkey [options] <eventcount>
  或者每次输入adb shell monkey [options] <eventcount>

2、monkey -help 列车简单的用法

3、monkey x 随机操作x次
  1)-v :用于指定信息级别总共有三级,默认是0级。提供测试启动、完整、最终结果和点击、触摸的操作百分比
  2)-v -v :1级,提供较为详细的测试信息,包括每个发送到activity的事件的信息
  3)-v -v -v :2级,提供最为详细的信息,包活选中和未选中的activity信息

  4)-p :monkey -p 包名 x 指定包名。如果指定包名则随机操作该app x次。如果不指定包名则对系统随机操作。可以同时指定多个包,则需要加多个-p,一个-p后面跟一个包名。具体查看手机中  有什么包或者那个app的包名是什么参考笔者的adb命令

  5)-s:伪随机数生成器的seed值,常常用于复现问题。如果seed值相同则生成的事件序列也是相同的

  6)--throtle:monkey --throttle xx 事件的延迟,即每次操作的时候中间都会有xx毫秒时间的延迟。如果不设置则以最快的速度运行

  7)--ignore-crashes:忽略崩溃,即在运行时遇到程序崩溃或者出现异常不会停止操作,直到到达设置的操作数
  8)--ignore-timeouts:忽略超时
  9)--ignore-security-exception:忽略安全异常
  10)--kill-process-after-error:发生错误后直接杀掉进程
  11)--monitor-native-crashes:指定是否监视并报告应用程序发生崩溃的本地代码
  12)--pct-touch xx(百分比):调整触摸事件的百分比(触摸事件是一个down-up事件,它发生在屏幕上的某单一位置),monkey -p com.xxx.yyy --pct-touch 5 300
  13)--pct-motion xx(百分比):调整动作事件的百分比(动作事件由屏幕上某处的一个down事件、一系列的伪随件机事和一个up事件组成)
  14)--pct-trackball xx(百分比):调整轨迹事件的百分比(轨迹事件由一个或几个随机的移动组成,有时还伴随有点击)
  15)--pct-nav xx(百分比):调整“基本”导航事件的百分比(导航事件由来自方向输入设备的up/down/left/right组成)
  16)--pct-majornav xx(百分比):调整“主要”导航事件的百分比(这些导航事件通常引发图形界面中的动作)

  17)>/User/testlog.txt:输入log。将log输出在/User/下的testlog.txt文件中

4、简单的操作
  monkey -p com.xxx.yyy -v -v 3000
  对com.xxx.yyy包进行3000次随机操作,并将log以2级的记录

5、复杂的操作
  monkey --throttle 1 -s 23 -p com.xxx.yyy --ignore-crashes --ignore-timeouts -v -v -v 60000>/User/local/log.txt 2>&1 &
  对com.xxx.yyy包进行60000次随机操作,每个事件延迟1ms,种子序列为23,忽略异常,忽略超时。将结果以最详细的方式记录并且输出在/User/local/路径下的log.txt文档中。2>&1固定写法,将忽略内容的日志也写进结果中。最后一个&表示如果是真机则拔掉usb线monkey继续操作不会停止,直到事件操作完60000次。除非关机不然monkey不会停止

6、测试及结果 

  monkey -p  com.tencent.qqlive -s 23 --throttle 2 --ignore-crashes --ignore-timeouts -v -v -v 300 2>&1 &

结果:

:Monkey: seed=23 count=300

:AllowPackage: com.tencent.qqlive

:IncludeCategory: android.intent.category.LAUNCHER

:IncludeCategory: android.intent.category.MONKEY

// Selecting main activities from category android.intent.category.LAUNCHER

//   - NOT USING main activity com.android.gallery3d.vivo.GalleryTabActivity (from package com.vivo.gallery)

//   - NOT USING main activity com.android.contacts.DialtactsContactsEntryActivity (from package com.android.contacts)

//   - NOT USING main activity com.android.dialer.TwelveKeyDialer (from package com.android.dialer)

//   - NOT USING main activity com.vivo.email.activity.Welcome (from package com.android.email)

//   - NOT USING main activity com.android.mms.ui.ConversationList (from package com.android.mms)

//   - NOT USING main activity com.android.settings.Settings (from package com.android.settings)

//   - NOT USING main activity com.android.bbksoundrecorder.SoundRecorder (from package com.android.bbksoundrecorder)

//   - NOT USING main activity com.android.VideoPlayer.VideoPlayer (from package com.android.VideoPlayer)

//   - NOT USING main activity com.bbk.calendar.MainActivity (from package com.bbk.calendar)

//   - NOT USING main activity com.android.camera.CameraActivity (from package com.android.camera)

//   - NOT USING main activity com.bbk.theme.Theme (from package com.bbk.theme)

//   - NOT USING main activity com.android.bbkmusic.WidgetToTrackActivity (from package com.android.bbkmusic)

//   - NOT USING main activity com.chaozh.iReader.ui.activity.WelcomeActivity (from package com.chaozh.iReader)

//   - NOT USING main activity com.didi.es.biz.startpage.StartActivity (from package com.didi.es.psngr)

//   - NOT USING main activity com.sohu.inputmethod.sogou.SogouIMELauncher (from package com.sohu.inputmethod.sogou)

//   - NOT USING main activity com.cto51.student.loading.LoadingActivity (from package com.cto51.student)

//   - NOT USING main activity com.android.bbkcalculator.Calculator (from package com.android.bbkcalculator)

//   - NOT USING main activity com.android.filemanager.FileManagerActivity (from package com.android.filemanager)

//   - NOT USING main activity com.android.notes.Notes (from package com.android.notes)

//   - NOT USING main activity com.android.BBKClock.Timer (from package com.android.BBKClock)

//   - NOT USING main activity com.vivo.weather.WeatherMain (from package com.vivo.weather)

//   - NOT USING main activity com.vivo.compass.CalibrationActivity (from package com.vivo.compass)

//   - NOT USING main activity com.vivo.Tips.MainActivity (from package com.vivo.Tips)

//   - NOT USING main activity com.bbk.cloud.activities.BBKCloudHomeScreen (from package com.bbk.cloud)

//   - NOT USING main activity com.vivo.space.ui.LogoActivity (from package com.vivo.space)

//   - NOT USING main activity com.vivo.browser.BrowserActivity (from package com.vivo.browser)

//   - NOT USING main activity com.bbk.appstore.ui.AppStore (from package com.bbk.appstore)

//   - NOT USING main activity com.vivo.game.ui.LogoActivity (from package com.vivo.game)

//   - NOT USING main activity com.iqoo.secure.MainGuideActivity (from package com.iqoo.secure)

//   - NOT USING main activity com.kingroot.kinguser.activitys.SliderMainActivity (from package com.kingroot.kinguser)

//   - NOT USING main activity com.tencent.mm.ui.LauncherUI (from package com.tencent.mm)

//   - NOT USING main activity com.baidu.netdisk.ui.Navigate (from package com.baidu.netdisk)

//   - NOT USING main activity cmb.pb.ui.PBInitActivity (from package cmb.pb)

//   + Using main activity com.tencent.qqlive.ona.activity.WelcomeActivity (from package com.tencent.qqlive)

//   - NOT USING main activity cn.wps.moffice.documentmanager.PreStartActivity (from package cn.wps.moffice_eng)

//   - NOT USING main activity com.play.taptap.ui.MainAct (from package com.taptap)

//   - NOT USING main activity com.autonavi.map.activity.SplashActivity (from package com.autonavi.minimap)

//   - NOT USING main activity com.youku.phone.ActivityWelcome (from package com.youku.phone)

//   - NOT USING main activity com.google.android.apps.authenticator.AuthenticatorActivity (from package com.dlka.android.apps.authenticator2)

//   - NOT USING main activity com.hangzhou.h890.main_module.activity.LaunchActivity (from package com.hangzhou.h890.EPSchool)

//   - NOT USING main activity com.tencent.wework.launch.LaunchSplashActivity (from package com.tencent.wework)

//   - NOT USING main activity com.tencent.mobileqq.activity.SplashActivity (from package com.tencent.mobileqq)

//   - NOT USING main activity com.epicgames.ue4.SplashActivity (from package com.tencent.tmgp.pubgmhd)

//   - NOT USING main activity com.alibaba.android.rimet.biz.SplashActivity (from package com.alibaba.android.rimet)

//   - NOT USING main activity com.eg.android.AlipayGphone.AlipayLogin (from package com.eg.android.AlipayGphone)

//   - NOT USING main activity com.kaixin.android.vertical_3_maobizi.ui.LaunchActivity (from package com.kaixin.android.vertical_3_maobizi)

//   - NOT USING main activity com.lantern.launcher.ui.MainActivity (from package com.snda.wifilocating)

//   - NOT USING main activity com.netease.cloudmusic.activity.LoadingActivity (from package com.netease.cloudmusic)

//   - NOT USING main activity tv.douyu.view.activity.SplashActivity (from package air.tv.douyu.android)

// Selecting main activities from category android.intent.category.MONKEY

//   - NOT USING main activity com.android.settings.Settings$RunningServicesActivity (from package com.android.settings)

//   - NOT USING main activity com.android.settings.Settings$StorageUseActivity (from package com.android.settings)

//   - NOT USING main activity com.bbk.launcher2.Launcher (from package com.bbk.launcher2)

//   - NOT USING main activity com.bbk.scene.launcher.theme.SceneLauncherThemeMainActivity (from package com.bbk.scene.launcher.theme)

//   - NOT USING main activity com.iqoo.engineermode.EngineerMode (from package com.iqoo.engineermode)

// Seeded: 23

// Event percentages:

//   0: 15.0%

//   1: 10.0%

//   2: 2.0%

//   3: 15.0%

//   4: -0.0%

//   5: 25.0%

//   6: 15.0%

//   7: 2.0%

//   8: 2.0%

//   9: 1.0%

//   10: 13.0%

:Switch: #Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=com.tencent.qqlive/.ona.activity.WelcomeActivity;end

// Allowing start of Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.tencent.qqlive/.ona.activity.WelcomeActivity } in package com.tencent.qqlive

Sleeping for 2 milliseconds

:Sending Trackball (ACTION_MOVE): 0:(-2.0,2.0)

:Sending Trackball (ACTION_MOVE): 0:(3.0,-2.0)

:Sending Trackball (ACTION_MOVE): 0:(-5.0,-5.0)

:Sending Trackball (ACTION_MOVE): 0:(-4.0,0.0)

:Sending Trackball (ACTION_MOVE): 0:(-1.0,2.0)

:Sending Trackball (ACTION_MOVE): 0:(4.0,-5.0)

:Sending Trackball (ACTION_MOVE): 0:(-4.0,1.0)

:Sending Trackball (ACTION_MOVE): 0:(-1.0,-5.0)

:Sending Trackball (ACTION_MOVE): 0:(-3.0,2.0)

:Sending Trackball (ACTION_MOVE): 0:(-3.0,2.0)

:Sending Touch (ACTION_DOWN): 0:(584.0,774.0)

:Sending Touch (ACTION_UP): 0:(585.7691,775.6711)

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 20    // KEYCODE_DPAD_DOWN

// Allowing start of Intent { cmp=com.tencent.qqlive/.ona.activity.HomeActivity } in package com.tencent.qqlive

// activityResuming(com.tencent.qqlive)

// Allowing start of Intent { cmp=com.tencent.qqlive/.tad.splash.AdLandingPageActivity } in package com.tencent.qqlive

:Sending Key (ACTION_UP): 20    // KEYCODE_DPAD_DOWN

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 263    // KEYCODE_CUSTOM_GESTURE

:Sending Key (ACTION_UP): 263    // KEYCODE_CUSTOM_GESTURE

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 82    // KEYCODE_MENU

:Sending Key (ACTION_UP): 82    // KEYCODE_MENU

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 3    // KEYCODE_HOME

:Sending Key (ACTION_UP): 3    // KEYCODE_HOME

// Rejecting start of Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] cmp=com.bbk.launcher2/.Launcher } in package com.bbk.launcher2

Sleeping for 2 milliseconds

:Sending Touch (ACTION_DOWN): 0:(184.0,133.0)

:Sending Touch (ACTION_UP): 0:(185.19217,130.19762)

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 20    // KEYCODE_DPAD_DOWN

:Sending Key (ACTION_UP): 20    // KEYCODE_DPAD_DOWN

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 23    // KEYCODE_DPAD_CENTER

:Sending Key (ACTION_UP): 23    // KEYCODE_DPAD_CENTER

Sleeping for 2 milliseconds

:Sending Touch (ACTION_DOWN): 0:(368.0,1855.0)

:Sending Touch (ACTION_UP): 0:(358.06006,1841.4702)

Sleeping for 2 milliseconds

:Sending Trackball (ACTION_MOVE): 0:(-1.0,4.0)

:Sending Trackball (ACTION_MOVE): 0:(1.0,-4.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,0.0)

:Sending Trackball (ACTION_MOVE): 0:(3.0,2.0)

:Sending Trackball (ACTION_MOVE): 0:(2.0,1.0)

:Sending Trackball (ACTION_MOVE): 0:(0.0,-5.0)

:Sending Trackball (ACTION_MOVE): 0:(-3.0,2.0)

:Sending Trackball (ACTION_MOVE): 0:(-4.0,4.0)

:Sending Touch (ACTION_DOWN): 0:(827.0,1387.0)

:Sending Touch (ACTION_MOVE): 0:(826.84424,1374.7859)

:Sending Touch (ACTION_MOVE): 0:(826.6829,1357.699)

:Sending Touch (ACTION_MOVE): 0:(819.34204,1349.8777)

:Sending Touch (ACTION_MOVE): 0:(809.8629,1346.0884)

:Sending Touch (ACTION_MOVE): 0:(797.5764,1327.3578)

:Sending Touch (ACTION_MOVE): 0:(793.1108,1308.8129)

:Sending Touch (ACTION_UP): 0:(793.0643,1293.0918)

Sleeping for 2 milliseconds

:Sending Trackball (ACTION_MOVE): 0:(-4.0,1.0)

:Sending Trackball (ACTION_MOVE): 0:(-3.0,1.0)

:Sending Trackball (ACTION_MOVE): 0:(-1.0,2.0)

:Sending Trackball (ACTION_MOVE): 0:(-3.0,-4.0)

:Sending Trackball (ACTION_MOVE): 0:(0.0,1.0)

:Sending Trackball (ACTION_MOVE): 0:(-1.0,0.0)

:Sending Trackball (ACTION_MOVE): 0:(1.0,0.0)

:Sending Trackball (ACTION_MOVE): 0:(0.0,2.0)

:Sending Trackball (ACTION_MOVE): 0:(-4.0,2.0)

:Sending Trackball (ACTION_MOVE): 0:(3.0,1.0)

:Sending Key (ACTION_DOWN): 262    // KEYCODE_WAKEUP_SWIPE

:Sending Key (ACTION_UP): 262    // KEYCODE_WAKEUP_SWIPE

Sleeping for 2 milliseconds

:Sending Touch (ACTION_DOWN): 0:(36.0,1008.0)

:Sending Touch (ACTION_UP): 0:(40.47904,1013.71045)

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 4    // KEYCODE_BACK

:Sending Key (ACTION_UP): 4    // KEYCODE_BACK

Sleeping for 2 milliseconds

:Sending Touch (ACTION_DOWN): 0:(336.0,1703.0)

:Sending Touch (ACTION_UP): 0:(339.1865,1703.8208)

Sleeping for 2 milliseconds

:Sending Touch (ACTION_DOWN): 0:(981.0,1662.0)

:Sending Touch (ACTION_UP): 0:(963.8276,1651.3307)

Sleeping for 2 milliseconds

:Sending Trackball (ACTION_MOVE): 0:(0.0,-3.0)

:Sending Trackball (ACTION_MOVE): 0:(-2.0,1.0)

:Sending Trackball (ACTION_MOVE): 0:(0.0,-3.0)

:Sending Trackball (ACTION_MOVE): 0:(3.0,0.0)

:Sending Trackball (ACTION_MOVE): 0:(-5.0,-4.0)

:Sending Trackball (ACTION_MOVE): 0:(-2.0,4.0)

:Sending Trackball (ACTION_MOVE): 0:(3.0,3.0)

:Sending Trackball (ACTION_MOVE): 0:(3.0,-3.0)

:Sending Trackball (ACTION_MOVE): 0:(-5.0,0.0)

:Sending Trackball (ACTION_MOVE): 0:(-1.0,-2.0)

:Sending Key (ACTION_DOWN): 23    // KEYCODE_DPAD_CENTER

// activityResuming(com.tencent.qqlive)

:Sending Key (ACTION_UP): 23    // KEYCODE_DPAD_CENTER

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 82    // KEYCODE_MENU

:Sending Key (ACTION_UP): 82    // KEYCODE_MENU

Sleeping for 2 milliseconds

:Sending Trackball (ACTION_MOVE): 0:(3.0,4.0)

:Sending Trackball (ACTION_MOVE): 0:(1.0,3.0)

:Sending Trackball (ACTION_MOVE): 0:(-3.0,3.0)

:Sending Trackball (ACTION_MOVE): 0:(1.0,-4.0)

:Sending Trackball (ACTION_MOVE): 0:(2.0,4.0)

:Sending Trackball (ACTION_MOVE): 0:(-1.0,-4.0)

:Sending Trackball (ACTION_MOVE): 0:(3.0,2.0)

:Sending Trackball (ACTION_MOVE): 0:(-3.0,2.0)

:Sending Trackball (ACTION_MOVE): 0:(0.0,0.0)

:Sending Trackball (ACTION_MOVE): 0:(-1.0,-1.0)

:Sending Touch (ACTION_DOWN): 0:(199.0,1238.0)

:Sending Touch (ACTION_POINTER_DOWN 1): 0:(199.08803,1237.9673) 1:(44.0,936.0)

:Sending Touch (ACTION_MOVE): 0:(199.38306,1237.1512) 1:(56.633686,934.4007)

:Sending Touch (ACTION_MOVE): 0:(199.4032,1232.6906) 1:(70.932396,931.53827)

:Sending Touch (ACTION_MOVE): 0:(199.47067,1232.6262) 1:(84.74173,909.7497)

:Sending Touch (ACTION_MOVE): 0:(200.05933,1224.0697) 1:(104.3616,908.0494)

:Sending Touch (ACTION_POINTER_UP 1): 0:(200.56824,1216.1976) 1:(117.07631,907.2735)

:Sending Touch (ACTION_UP): 0:(200.68095,1208.8142)

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 228    // KEYCODE_12

//[calendar_time:2018-05-21 09:18:48.997  system_uptime:450692748]

// Sending event #100

:Sending Key (ACTION_UP): 228    // KEYCODE_12

Sleeping for 2 milliseconds

:Sending Touch (ACTION_DOWN): 0:(918.0,982.0)

:Sending Touch (ACTION_MOVE): 0:(910.02106,987.6015)

:Sending Touch (ACTION_MOVE): 0:(909.90607,1007.29004)

:Sending Touch (ACTION_MOVE): 0:(902.4735,1009.3603)

:Sending Touch (ACTION_MOVE): 0:(899.16034,1014.9257)

:Sending Touch (ACTION_MOVE): 0:(892.8468,1025.72)

:Sending Touch (ACTION_MOVE): 0:(888.47064,1042.8936)

:Sending Touch (ACTION_UP): 0:(881.6432,1053.1315)

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 82    // KEYCODE_MENU

// Injection Failed

:Sending Key (ACTION_UP): 82    // KEYCODE_MENU

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 23    // KEYCODE_DPAD_CENTER

:Sending Key (ACTION_UP): 23    // KEYCODE_DPAD_CENTER

Sleeping for 2 milliseconds

:Sending Trackball (ACTION_MOVE): 0:(4.0,2.0)

:Sending Trackball (ACTION_MOVE): 0:(-1.0,2.0)

:Sending Trackball (ACTION_MOVE): 0:(-2.0,-3.0)

:Sending Trackball (ACTION_MOVE): 0:(-2.0,-4.0)

:Sending Trackball (ACTION_MOVE): 0:(2.0,-4.0)

:Sending Trackball (ACTION_MOVE): 0:(-2.0,4.0)

:Sending Trackball (ACTION_MOVE): 0:(-4.0,3.0)

:Sending Trackball (ACTION_MOVE): 0:(0.0,0.0)

:Sending Trackball (ACTION_MOVE): 0:(-5.0,-3.0)

:Sending Trackball (ACTION_MOVE): 0:(-3.0,-1.0)

:Sending Key (ACTION_DOWN): 238    // KEYCODE_TV_SATELLITE_BS

:Sending Key (ACTION_UP): 238    // KEYCODE_TV_SATELLITE_BS

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 23    // KEYCODE_DPAD_CENTER

:Sending Key (ACTION_UP): 23    // KEYCODE_DPAD_CENTER

Sleeping for 2 milliseconds

:Sending Trackball (ACTION_MOVE): 0:(-2.0,-5.0)

:Sending Trackball (ACTION_MOVE): 0:(1.0,4.0)

:Sending Trackball (ACTION_MOVE): 0:(3.0,-3.0)

:Sending Trackball (ACTION_MOVE): 0:(-3.0,4.0)

:Sending Trackball (ACTION_MOVE): 0:(-2.0,4.0)

:Sending Trackball (ACTION_MOVE): 0:(-5.0,-3.0)

:Sending Trackball (ACTION_MOVE): 0:(2.0,4.0)

:Sending Trackball (ACTION_MOVE): 0:(4.0,1.0)

:Sending Trackball (ACTION_MOVE): 0:(-1.0,1.0)

:Sending Trackball (ACTION_MOVE): 0:(-1.0,-1.0)

:Sending Flip keyboardOpen=false

Got IOException performing flipjava.io.IOException: write failed: EINVAL (Invalid argument)

// Injection Failed

Sleeping for 2 milliseconds

:Sending Touch (ACTION_DOWN): 0:(692.0,365.0)

:Sending Touch (ACTION_UP): 0:(696.411,354.99133)

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 21    // KEYCODE_DPAD_LEFT

:Sending Key (ACTION_UP): 21    // KEYCODE_DPAD_LEFT

Sleeping for 2 milliseconds

:Sending Trackball (ACTION_MOVE): 0:(3.0,-4.0)

:Sending Trackball (ACTION_MOVE): 0:(-1.0,3.0)

:Sending Trackball (ACTION_MOVE): 0:(1.0,-5.0)

:Sending Trackball (ACTION_MOVE): 0:(-5.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:(-5.0,-2.0)

:Sending Trackball (ACTION_MOVE): 0:(-2.0,2.0)

:Sending Trackball (ACTION_MOVE): 0:(2.0,-2.0)

:Sending Trackball (ACTION_MOVE): 0:(-3.0,-3.0)

:Sending Touch (ACTION_DOWN): 0:(108.0,370.0)

:Sending Touch (ACTION_MOVE): 0:(112.930046,370.1433)

:Sending Touch (ACTION_MOVE): 0:(113.56628,371.7848)

:Sending Touch (ACTION_MOVE): 0:(114.19526,375.22922)

:Sending Touch (ACTION_UP): 0:(116.88367,378.2378)

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 123    // KEYCODE_MOVE_END

:Sending Key (ACTION_UP): 123    // KEYCODE_MOVE_END

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 260    // KEYCODE_TS_LARGE_SUPPRESSION

:Sending Key (ACTION_UP): 260    // KEYCODE_TS_LARGE_SUPPRESSION

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 157    // KEYCODE_NUMPAD_ADD

:Sending Key (ACTION_UP): 157    // KEYCODE_NUMPAD_ADD

Sleeping for 2 milliseconds

:Sending Trackball (ACTION_MOVE): 0:(-4.0,-4.0)

:Sending Trackball (ACTION_MOVE): 0:(4.0,-3.0)

:Sending Trackball (ACTION_MOVE): 0:(2.0,4.0)

:Sending Trackball (ACTION_MOVE): 0:(1.0,3.0)

:Sending Trackball (ACTION_MOVE): 0:(1.0,-2.0)

:Sending Trackball (ACTION_MOVE): 0:(3.0,-5.0)

:Sending Trackball (ACTION_MOVE): 0:(4.0,-1.0)

:Sending Trackball (ACTION_MOVE): 0:(0.0,2.0)

:Sending Trackball (ACTION_MOVE): 0:(-4.0,-4.0)

:Sending Trackball (ACTION_MOVE): 0:(-5.0,-4.0)

:Sending Touch (ACTION_DOWN): 0:(326.0,1831.0)

:Sending Touch (ACTION_UP): 0:(313.87247,1843.9445)

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 82    // KEYCODE_MENU

:Sending Key (ACTION_UP): 82    // KEYCODE_MENU

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 82    // KEYCODE_MENU

:Sending Key (ACTION_UP): 82    // KEYCODE_MENU

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 23    // KEYCODE_DPAD_CENTER

:Sending Key (ACTION_UP): 23    // KEYCODE_DPAD_CENTER

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 19    // KEYCODE_DPAD_UP

:Sending Key (ACTION_UP): 19    // KEYCODE_DPAD_UP

Sleeping for 2 milliseconds

:Sending Touch (ACTION_DOWN): 0:(735.0,1137.0)

:Sending Touch (ACTION_UP): 0:(729.31134,1142.0072)

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 74    // KEYCODE_SEMICOLON

:Sending Key (ACTION_UP): 74    // KEYCODE_SEMICOLON

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 82    // KEYCODE_MENU

:Sending Key (ACTION_UP): 82    // KEYCODE_MENU

Sleeping for 2 milliseconds

:Sending Touch (ACTION_DOWN): 0:(910.0,740.0)

:Sending Touch (ACTION_UP): 0:(920.1081,741.1603)

Sleeping for 2 milliseconds

:Sending Touch (ACTION_DOWN): 0:(820.0,745.0)

:Sending Touch (ACTION_UP): 0:(810.5797,745.5154)

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 23    // KEYCODE_DPAD_CENTER

:Sending Key (ACTION_UP): 23    // KEYCODE_DPAD_CENTER

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 23    // KEYCODE_DPAD_CENTER

:Sending Key (ACTION_UP): 23    // KEYCODE_DPAD_CENTER

Sleeping for 2 milliseconds

:Sending Trackball (ACTION_MOVE): 0:(-1.0,2.0)

:Sending Trackball (ACTION_MOVE): 0:(2.0,-3.0)

:Sending Trackball (ACTION_MOVE): 0:(-2.0,1.0)

//[calendar_time:2018-05-21 09:18:51.028  system_uptime:450694731]

// Sending event #200

:Sending Trackball (ACTION_MOVE): 0:(2.0,3.0)

:Sending Trackball (ACTION_MOVE): 0:(-3.0,4.0)

:Sending Trackball (ACTION_MOVE): 0:(-5.0,3.0)

:Sending Trackball (ACTION_MOVE): 0:(4.0,-2.0)

:Sending Trackball (ACTION_MOVE): 0:(0.0,2.0)

:Sending Trackball (ACTION_MOVE): 0:(4.0,0.0)

:Sending Trackball (ACTION_MOVE): 0:(3.0,0.0)

:Sending Trackball (ACTION_DOWN): 0:(0.0,0.0)

:Sending Trackball (ACTION_UP): 0:(0.0,0.0)

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 19    // KEYCODE_DPAD_UP

:Sending Key (ACTION_UP): 19    // KEYCODE_DPAD_UP

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 20    // KEYCODE_DPAD_DOWN

:Sending Key (ACTION_UP): 20    // KEYCODE_DPAD_DOWN

Sleeping for 2 milliseconds

:Sending Touch (ACTION_DOWN): 0:(493.0,602.0)

:Sending Touch (ACTION_POINTER_DOWN 1): 0:(489.3213,600.8783) 1:(971.0,1679.0)

:Sending Touch (ACTION_MOVE): 0:(482.8369,596.66223) 1:(964.7397,1692.8387)

:Sending Touch (ACTION_MOVE): 0:(478.49704,594.0172) 1:(963.5418,1701.5529)

:Sending Touch (ACTION_MOVE): 0:(471.4184,590.4491) 1:(958.0889,1706.068)

:Sending Touch (ACTION_MOVE): 0:(464.647,586.8379) 1:(956.5534,1713.3955)

:Sending Touch (ACTION_POINTER_UP 1): 0:(459.91425,581.6231) 1:(953.19196,1725.8336)

:Sending Touch (ACTION_UP): 0:(458.05426,575.6825)

Sleeping for 2 milliseconds

:Sending Touch (ACTION_DOWN): 0:(378.0,1532.0)

:Sending Touch (ACTION_POINTER_DOWN 1): 0:(377.84912,1517.4033) 1:(1077.0,1290.0)

:Sending Touch (ACTION_MOVE): 0:(377.7412,1507.8181) 1:(1079.7617,1273.7279)

:Sending Touch (ACTION_MOVE): 0:(377.59314,1493.3823) 1:(1080.0,1269.2837)

:Sending Touch (ACTION_MOVE): 0:(377.3333,1479.5858) 1:(1080.0,1248.4834)

:Sending Touch (ACTION_MOVE): 0:(377.0882,1468.5681) 1:(1080.0,1245.4327)

:Sending Touch (ACTION_MOVE): 0:(376.8815,1455.04) 1:(1080.0,1221.7372)

:Sending Touch (ACTION_MOVE): 0:(376.79596,1439.7148) 1:(1080.0,1199.1908)

:Sending Touch (ACTION_MOVE): 0:(376.7334,1429.693) 1:(1080.0,1178.0173)

:Sending Touch (ACTION_POINTER_UP 1): 0:(376.64453,1420.4636) 1:(1080.0,1167.6306)

:Sending Touch (ACTION_UP): 0:(376.40424,1409.9125)

Sleeping for 2 milliseconds

:Sending Touch (ACTION_DOWN): 0:(199.0,1832.0)

:Sending Touch (ACTION_MOVE): 0:(198.4573,1845.8867)

// Injection Failed

:Sending Touch (ACTION_MOVE): 0:(194.82933,1848.9222)

// Injection Failed

:Sending Touch (ACTION_MOVE): 0:(186.27072,1863.8077)

// Injection Failed

:Sending Touch (ACTION_MOVE): 0:(180.5924,1868.0641)

// Injection Failed

:Sending Touch (ACTION_MOVE): 0:(171.16846,1877.9966)

// Injection Failed

:Sending Touch (ACTION_MOVE): 0:(163.72751,1889.2833)

// Injection Failed

:Sending Touch (ACTION_MOVE): 0:(153.96924,1890.8129)

// Injection Failed

:Sending Touch (ACTION_UP): 0:(147.82706,1908.2029)

// Injection Failed

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 23    // KEYCODE_DPAD_CENTER

:Sending Key (ACTION_UP): 23    // KEYCODE_DPAD_CENTER

Sleeping for 2 milliseconds

:Switch: #Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=com.tencent.qqlive/.ona.activity.WelcomeActivity;end

// Allowing start of Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.tencent.qqlive/.ona.activity.WelcomeActivity } in package com.tencent.qqlive

Sleeping for 2 milliseconds

:Sending Touch (ACTION_DOWN): 0:(517.0,1332.0)

// Injection Failed

:Sending Touch (ACTION_UP): 0:(518.09045,1328.0283)

// Injection Failed

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 25    // KEYCODE_VOLUME_DOWN

// activityResuming(com.tencent.qqlive)

:Sending Key (ACTION_UP): 25    // KEYCODE_VOLUME_DOWN

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 297    // 297

:Sending Key (ACTION_UP): 297    // 297

Sleeping for 2 milliseconds

:Sending Touch (ACTION_DOWN): 0:(1070.0,441.0)

:Sending Touch (ACTION_UP): 0:(1070.6196,423.70654)

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 268    // 268

:Sending Key (ACTION_UP): 268    // 268

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 22    // KEYCODE_DPAD_RIGHT

:Sending Key (ACTION_UP): 22    // KEYCODE_DPAD_RIGHT

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 140    // KEYCODE_F10

:Sending Key (ACTION_UP): 140    // KEYCODE_F10

Sleeping for 2 milliseconds

:Sending Touch (ACTION_DOWN): 0:(325.0,1219.0)

:Sending Touch (ACTION_UP): 0:(332.37204,1216.1332)

Sleeping for 2 milliseconds

:Sending Touch (ACTION_DOWN): 0:(909.0,1381.0)

:Sending Touch (ACTION_MOVE): 0:(908.5926,1358.3804)

:Sending Touch (ACTION_UP): 0:(888.16626,1344.9875)

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 19    // KEYCODE_DPAD_UP

:Sending Key (ACTION_UP): 19    // KEYCODE_DPAD_UP

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 14    // KEYCODE_7

:Sending Key (ACTION_UP): 14    // KEYCODE_7

Sleeping for 2 milliseconds

:Sending Touch (ACTION_DOWN): 0:(588.0,1012.0)

:Sending Touch (ACTION_UP): 0:(598.9902,1004.4162)

Sleeping for 2 milliseconds

:Sending Touch (ACTION_DOWN): 0:(986.0,19.0)

:Sending Touch (ACTION_UP): 0:(986.7857,32.59584)

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 21    // KEYCODE_DPAD_LEFT

:Sending Key (ACTION_UP): 21    // KEYCODE_DPAD_LEFT

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 259    // KEYCODE_HELP

:Sending Key (ACTION_UP): 259    // KEYCODE_HELP

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 22    // KEYCODE_DPAD_RIGHT

:Sending Key (ACTION_UP): 22    // KEYCODE_DPAD_RIGHT

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 49    // KEYCODE_U

:Sending Key (ACTION_UP): 49    // KEYCODE_U

Sleeping for 2 milliseconds

:Sending Touch (ACTION_DOWN): 0:(857.0,412.0)

:Sending Touch (ACTION_UP): 0:(876.2802,403.5798)

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 21    // KEYCODE_DPAD_LEFT

:Sending Key (ACTION_UP): 21    // KEYCODE_DPAD_LEFT

Sleeping for 2 milliseconds

:Sending Touch (ACTION_DOWN): 0:(668.0,1330.0)

:Sending Touch (ACTION_UP): 0:(655.6692,1320.9884)

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 256    // KEYCODE_TV_CONTENTS_MENU

:Sending Key (ACTION_UP): 256    // KEYCODE_TV_CONTENTS_MENU

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 19    // KEYCODE_DPAD_UP

:Sending Key (ACTION_UP): 19    // KEYCODE_DPAD_UP

Sleeping for 2 milliseconds

:Sending Key (ACTION_DOWN): 21    // KEYCODE_DPAD_LEFT

:Sending Key (ACTION_UP): 21    // KEYCODE_DPAD_LEFT

Sleeping for 2 milliseconds

:Sending Trackball (ACTION_MOVE): 0:(-5.0,-4.0)

:Sending Trackball (ACTION_MOVE): 0:(0.0,-4.0)

:Sending Trackball (ACTION_MOVE): 0:(1.0,2.0)

:Sending Trackball (ACTION_MOVE): 0:(-1.0,-2.0)

:Sending Trackball (ACTION_MOVE): 0:(-1.0,2.0)

:Sending Trackball (ACTION_MOVE): 0:(3.0,-5.0)

:Sending Trackball (ACTION_MOVE): 0:(2.0,3.0)

:Sending Trackball (ACTION_MOVE): 0:(-3.0,-2.0)

:Sending Trackball (ACTION_MOVE): 0:(-5.0,-4.0)

Events injected: 300

:Sending rotation degree=0, persist=false

:Dropped: keys=1 pointers=10 trackballs=0 flips=1 rotations=0

## Network stats: elapsed time=4407ms (0ms mobile, 0ms wifi, 4407ms not connected)

// Monkey finished

monkey操作的更多相关文章

  1. Appium -- adb monkey操作(一)

    1.Monkey简介在Android的官方自动化测试领域有一只非常著名的"猴子"叫Monkey,这只"猴子"一旦启动,就会让被测的Android应用程序像猴子一 ...

  2. Android Monkey自己主动化測试

    前言 假设你做Android开发,还没有使用过Monkey进行測试,那么今天看到这篇文章,希望能解决你Android測试中的一些问题.起码能帮你省点測试的时间而且发现很多其它的问题. Monkey简单 ...

  3. 小白Monkey学习笔记

    Monkey是google提供的一款对Android app进行压力测试工具,基于随机坐标位置,进行点击.滑动.输入等操作. Monkey的环境配置 pc电脑需要配置adb环境 Monkey程序由An ...

  4. 利用Monkey进行APP测试

    APP测试策略 功能测试 安装.卸载测试 升级测试(跨版本) 数据丢失 版本兼容 业务逻辑测试 UI测试 异常测试 适配测试 软件 兼容性测试 硬件 性能测试 效率测试 启动时间 响应时间 页面流畅度 ...

  5. IOS的Crash情况在Crashlytics平台上统计解决方案的一点遗憾(截止到2015年6月14日)

    平台针对特定版本的monkey操作后数量统计,按时间段定时去获取,最后根据操作批次出具分析报告: 问题是crashlytics平台仅提供一个BS登录查看WEB后台,所以无法通过API或者DB去直接获取 ...

  6. 这一年多来,阿里Blink测试体系如何从0走向成熟?

    引言 Apache Flink是面向数据流处理和批处理的分布式开源计算框架,2016年阿里巴巴引入Flink框架,改造为Blink.2017年,阿里整合了所有流计算产品,决定以Blink引擎为基础,打 ...

  7. Android 性能测试之内存 --- 追加腾讯性能案例,安卓抓取性能扫盲帖

    内存测试: 思路 目前做的是酒店APP,另下载安装几个个第三方酒店的APP以方便对比(相当于可以做竞品测试) 数据的获取来源是ADB底层命令,而且最好是不需要root权限,因为很多手机root很麻烦或 ...

  8. blink测试技术介绍

    引言: flink是面向数据流处理和批处理的分布式开源计算框架.2016年阿里巴巴引入flink框架,改造为blink,将其运用到搜索及推荐的离线实时计算中,成功解决了搜索.推荐实时大数据量计算的痛点 ...

  9. Monkey压力测试操作步骤说明

    一.需配置java环境和android环境 JDK安装包:链接:https://pan.baidu.com/s/1SlnBOS0f3m2wVpEZBPfmag                      ...

随机推荐

  1. boost pool_allocator 报错 'rebind'

    #include "stdafx.h" #include <vector> #include <boost/pool/pool.hpp> int _tmai ...

  2. Netmask, 子网与 CIDR (Classless Interdomain Routing)

    Netmask, 子网与 CIDR (Classless Interdomain Routing) 我们前面谈到 IP 是有等级的,而设定在一般计算机系统上面的则是 Class A, B, C.现在我 ...

  3. OpenCV——彩色图像转成灰度图像

    // PS_Algorithm.h #ifndef PS_ALGORITHM_H_INCLUDED #define PS_ALGORITHM_H_INCLUDED #include <iostr ...

  4. Java语言实现二分法

    二分法是一个简单,高效,并广泛应用的查找方法 import java.util.arrays; public class BinarySearch { public static int rank(i ...

  5. ubuntu12.04:Mysql数据库:自动安装

    打开终端,输入下面命令: 1 sudo apt-get install mysql-server 2 sudo apt-get install mysql-client 一旦安装完成,MySQL 服务 ...

  6. Java Web开发中路径问题小结

     Java Web开发中,路径问题是个挺麻烦的问题,本文小结了几个常见的路径问题,希望能对各位读者有所帮助. (1) Web开发中路径的几个基本概念 假设在浏览器中访问了如下的页面,如图1所示: 图1 ...

  7. JAVA 平台

    由Java虚拟机和Java核心类所构成.它为纯Java程序提供了统一的编程接口,而不管下层操作系统是什么. 目录 1Java术语 2移动平台 3桌面应用平台 4企业级平台 5JRE的成分     1J ...

  8. oracle数据库中的trim不起作用

    在项目中使用datastage软件将sqlserver数据库的数据导入到oracle中的时候,出现了一些空格,然而使用trim相对应的字段发现没有作用,空格还存在,并没有去掉. 使用length(.. ...

  9. Java内存模型与指令重排

    Java内存模型与指令重排 本文暂不讲JMM(Java Memory Model)中的主存, 工作内存以及数据如何在其中流转等等, 这些本身还牵扯到硬件内存架构, 直接上手容易绕晕, 先从以下几个点探 ...

  10. macOS High Sierra Terminal巨卡问题的解决

    输入命令特别卡,拖拽窗口也特别卡,想到可能和界面渲染有关系,到设置里面把不透明度调成满值,问题解决. 真正的技术原因是看iOS开发相关的书的时候,书里面有这方面渲染消耗的提示说明.