MonkeyAndLinux学习
2017-04-27 15:13:33 0 举报
AI智能生成
Monkey And Linux学习
作者其他创作
大纲/内容
MonkeyAndLinux学习
Monkey
定义
Monkey 是一个可以运行在模拟器或设备上的程序,它可以生成用户时间的伪随机序列,如点击,触屏,或者抓取,也包含一系列的系统级的事件。我们可以使用Monkey对自己开发的应用程序做压力测试,使用随机且可重复的操作
Monkey测试是Android平台自动化测试的一种手段,通过Monkey程序模拟用户触摸屏幕、滑动Trackball、按键等操作来对设备上的程序进行压力测试,检测程序多久的时间会发生异常
伪随机事件
seed相同,则随机序列不变;并且在一定时间内,所生成的随机事件不重复
monkey程序说明
span style=\
\u00A0Monkey.jar程序是由一个名为“monkey”的Shell脚本来启动执行,shell脚本在Android文件系统中的存放路径是:/system/bin/monkey;
monkey命令
-p+包名
指定monkey命令作用得包
\u00A0-v
指定反馈信息级别
日志级别 Level0:\u00A0–v 100
缺省值,仅提供启动提示、测试完成和最终结果等少量信息
\u00A0提供较为详细的日志,包括每个发送到Activity的事件信息
最详细的日志,包括了测试中选中/未选中的Activity信息
-c
如果用此参数指定了一个或几个类别, Monkey 将只允许系统启动被这些类别中的某个类别列出的 Activity\u00A0
用于指定伪随机数生成器的seed值,如果seed相同,则两次Monkey测试所产生的事件序列也相同的
--ignore-crashes
用于指定当应用程序崩溃时(Force& Close错误),Monkey是否停止运行。如果使用此参数,即使应用程序崩溃,Monkey依然会发送事件,直\u00A0到事件计数完成
\u00A0 --pct-{+事件类别}{+事件类别百分比}
用于指定每种类别事件的数目百分比(在Monkey事件序列中,该类事件数目占总事件数目的百分比)
adb命令
am
Linux
0 条评论
回复 删除
下一页