当前位置:网站首页>Monkey测试
Monkey测试
2022-07-02 03:44:00 【~heart将心比心】
一、什么是 Monkey 测试
Monkey 测试是通过向系统发送伪随机的用户事件流(如按键输入、触摸屏输入、手势输入等),实现对应用程序客户端的稳定性测试;
通俗来说,Monkey 测试即“猴子测试”,是指像猴子一样,不知道程序的任何用户交互方面的知识,就对界面进行无目的、乱点乱按的操作;
Monkey 测试是一种为了测试软件的稳定性、健壮性的快速有效的方法;
Monkey 程序是 Android 系统自带的,由 Java 语言写成,在 Android 文件系统中的存放路径是: /system/framework/monkey.jar;
Monkey 程序需要通过 adb 来运行。
二、操作步骤
安装并配置好 adb 环境,并通过 adb 连接好设备;
获取被测应用的包名;
执行 Monkey 命令进行测试
三、Monkey 命令说明
adb shell monkey + 行为参数 + ">" + {日志保存路径}
adb shell monkey -p XXXXX --throttle 100 --ignore-crashes --ignore-timeouts --ignore-security-exceptions --ignore-native-crashes --monitor-native-crashes -v -v -v 1000 > d:\mylog.log
-p XXXXX -p 后面写包名(adb shell pm list package) 查看手机上所有的安装包
--throttle { 毫秒单位时间} 事件之间插入的固定延迟,单位毫秒。通过这个选项可以减缓Monkey的执行速度。如果不指定,Monkey将尽可能快的产生并执行事件
--ignore-crashes Monkey 测试时忽略应用程序崩溃(Force&Close错误),若发生奔溃,将继续发送事件给系统,直到事件计数完成(若不设置此项,在遇到奔溃时,Monkey 将停止运行)
--ignore-timeouts Monkey 测试时忽略应用程序发生的超时错误,若发生超时,将继续发送事件给系统,直到事件计数完成(若不设置此项,在遇到超时时,Monkey 将停止运行)
--ignore-security-exceptions Monkey 测试时忽略程序发生的异常错误,若发生异常,将继续发送事件给系统,直到事件计数完成(若不设置此项,在遇到异常时,Monkey 将停止运行)
--ignore-native-crashes Monkey 测试时忽略本地代码导致的崩溃,若发生崩溃,将继续发送事件给系统,直到事件计数完成(若不设置此项,在遇到本地代码导致的奔溃时,Monkey 将停止运行)
--monitor-native-crashes 监视崩溃时的本地代码
-v -v -v
每个 -v 都将增加反馈信息的级别。共3个级别,因此 -v -v -v 可以提供最详细的设置信息。
- -v:0级,除启动提示、测试完成和最终结果外提供较少信息
- -v -v:1级,提供较详细测试信息,如逐个发送到 Activity 的事件
- -v -v -v:2级,提供更详细安装信息,如测试中被选中或未被选中的 Activity
1000000 Monkey 测试事件次数
d:\mylog.log Monkey 测试日志记录文件
边栏推荐
- Basic syntax of unity script (6) - specific folder
- 【直播回顾】战码先锋首期8节直播完美落幕,下期敬请期待!
- Qt的网络连接方式
- Class design basis and advanced
- MySQL index, transaction and storage engine
- [live broadcast review] the first 8 live broadcasts of battle code Pioneer have come to a perfect end. Please look forward to the next one!
- 5G时代全面到来,浅谈移动通信的前世今生
- 接口调试工具模拟Post上传文件——ApiPost
- Welcome the winter vacation multi school league game 2 partial solution (B, C, D, F, G, H)
- Suggestions on settlement solution of u standard contract position explosion
猜你喜欢

Recently, the weather has been extremely hot, so collect the weather data of Beijing, Shanghai, Guangzhou and Shenzhen last year, and make a visual map

The 11th Blue Bridge Cup single chip microcomputer provincial competition
![[designmode] builder model](/img/e8/855934d57eb6868a4d188b2bb1d188.png)
[designmode] builder model

The 6th Blue Bridge Cup single chip microcomputer provincial competition

NLog use

Homework in Chapter 3 of slam course of dark blue vision -- derivative application of T6 common functions

Comment élaborer une stratégie nuageuse à l'ère des nuages mixtes

The first game of the 11th provincial single chip microcomputer competition of the Blue Bridge Cup

高性能 低功耗Cortex-A53核心板 | i.MX8M Mini

《MATLAB 神经网络43个案例分析》:第41章 定制神经网络的实现——神经网络的个性化建模与仿真
随机推荐
What kind of interview is more effective?
"Analysis of 43 cases of MATLAB neural network": Chapter 41 implementation of customized neural network -- personalized modeling and Simulation of neural network
[yolo3d]: real time detection of end-to-end 3D point cloud input
js生成随机数
毕设-基于SSM电影院购票系统
Flutter中深入了解MaterialApp,常用属性解析
Vite: configure IP access
5G时代全面到来,浅谈移动通信的前世今生
蓝桥杯单片机省赛第五届
What is the logical structure of database file
The first practical project of software tester: web side (video tutorial + document + use case library)
SQL:常用的 SQL 命令
C语言:逻辑运算和判断选择结构例题
PY3, PIP appears when installing the library, warning: ignoring invalid distribution -ip
Welcome the winter vacation multi school league game 2 partial solution (B, C, D, F, G, H)
The second game of the 12th provincial single chip microcomputer competition of the Blue Bridge Cup
蓝桥杯单片机省赛第十一届第二场
《MATLAB 神经网络43个案例分析》:第41章 定制神经网络的实现——神经网络的个性化建模与仿真
In depth analysis of C language - variable error prone knowledge points # dry goods inventory #
SQL Yiwen get window function