Monkey命令

(1):adb shell monkey --查看monkey是否运行。

(2):adb devices --查看手机的序列号以及设备

(3):adb -s 手机序列号 install E:\安装文件.apk --安装应用程序

(4):adb shell pm list packages --查看软件应用包名。

(5):adb -s 手机序列号 uninstall 手机应用包名 --卸载应用软件

(6):adb pull /sdcard/tmp/error_fs.dat D:/(盘符) --在SD卡tmp文件夹里添加.dat文件,把SD卡文件上传到pc端指定盘符

(7):adb -s 手机序列号 push D:/a.rar /sdcard/ --pc端新建的文件,上传到手机上sd卡

(8):adb shell ls --查看手机当前目录的所有内容

(9):adb shell su root cd /data/data ls --用shell命令来访问手机系统目录进行查看,提醒在操作的过程中需要切换root用户。显示 00 $是没有进入root权限,显示#是进入root权限。

(10)adb shell monkey -p com.htmitech.emportal 100 --登陆软件界面

(11)adb shell monkey -v -v -p com.htmitech.emportal 100 > D:/monkey.txt --保存查看log日志

(12)adb shell monkey -v 500 --随机点击500次

(13)adb shell monkey--是指随机发送事件数

(14)adb shell monkey 1000 --发送1000个随机事件

(15)adb shell monkey [options]--这里options是指monkey可传入的参数

(16)adb shell monkey -h -- -h:显示monkey参数帮助信息usage

(17)adb shell monkey -v-- -v:打印出日志信息,多一个-v就是多一个级别(-v -v -v)

(18)adb shell monkey -f /mnt/sdcard/test 1 --这里的1为循环次数而非事件数

(19)adb shell monkey -s--后接随机数生成器的seed值--throttle指令间固定时间间隔:

(20)adb shell monkey --throttle--throttle:后面接时间,单位为ms(),表示事件之间的固定延迟(即执行每一个指令间隔的时间)事件百分比:调整触摸事件的百分比,使用--ptc-touch。

(21)$ adb shell monkey --ptc-touch--ptc-touch:后面接触摸事件百分比

(22)adb shell monkey --ptc-motion--ptc-motion:后面接动作事件百分比

(23)adb shell monkey --ptc-trackball--ptc-trackball:后面接轨迹球事件百分比

(24)adb shell monkey --ptc-nav--ptc-nav:后面接基本导航事件百分比

(25)adb shell monkey --ptc-majornav--ptc-majornav:后面接主要导航事件百分比

(26)adb shell monkey --ptc-syskeys--ptc-syskeys:后面接系统按键事件百分比

(27)adb shell monkey --ptc-appswtich--ptc-appswitch:后面接应用启动事件百分比monkey的约束类命令:(28)adb shell monkey -p-- -p:后面接一个或多个包名()

(29)adb shell monkey -c-- -c:后面接一个或多个类别名(即参数),monkey将只允许系统启动这些类别中某个类别列出的Activity

(30)adb shell monkey --dbg-no-events----dbg-no-events:在设置此选项后,monkey将进行初始启动,进入到某个测试Activity中不会进一步生成事件

(31)adb shell monkey --hprof----hprof:在设置此选项后,将在monkey事件序列前后立即生成profilfing report(32)adb shell monkey --ignore-crashes--ignore-crashes:在设置此选项后,当应用程序崩溃或发生失控异常时,monkey将继续运行直到计数完成。

(33)adb shell monkey --kill-process-after-error----kill-process-after-error:在设置此选项后,当monkey因为应用程序发生错误而停止时,将会通知系统停止发生错误的进程。如果不设置此选项,在monkey停止时发

(34)adb shell monkey --ignore-timeouts--ignore-timeouts:在设置此选项后,当应用程序发生任何超时错误(如ANP,即Application Not Responding)时,monkey将继续运行直到计数完成。

(35)adb shell monkey --ignore-security-exceptions----ignore-security-exceptions:在设置此选项后,当应用程序发生任何权限错误(如启动一个需要某些权限的Activity)时,monkey将继续运行直到计数完成

(36)adb shell monkey --monitor-native-crashes----monitor-native-crashes:在设置此选项后,monkey运行时native code的崩溃事件将被监视并报告。

(37)adb shell monkey --wait-dbg--wait-dbg:在设置此选项后,将暂停执行中的monkey,直到有调试器与它连接。 monkey脚本编写 1,轨迹球事件 DispatchTrackball(long downTime, long eventTime, int action,float x, float y, float pressure,float size, int metaState,float xPrecision, float yPrecision, int device, int edgeFlags) Monkey日志等级错误:

Monkey日志等级错误:

你可能感兴趣的:(Monkey命令)