案头见蠹鱼,犹胜凡俦侣。这篇文章主要讲述基于Monkey的Android自己主动化測试相关的知识,希望能为你提供帮助。
【基于Monkey的Android自己主动化測试】使用Monkey,能够相应用的稳定性和健壮性进行压測,測试的结果对于产品在复杂环境下的执行情况有很重要的參考意义。
以下是一个演示样例,带有对应的凝视。简单明了。供大家參考。
#!/bin/bash# define case base information case_name="monkey case" case_ver="1.0.2" case_package_name="cn.packagename.platform" case_event_scale=5000echo "-------------------------------------" echo "Job name:${case_name}, ver:${case_ver}" echo "-------------------------------------"# start job echo "List all connected device and checking them..." current_date=`date "+%Y-%m-%d %H:%M:%S"` adb devices > devices.list if grep -q " device" devices.list then echo "The package ready for send pseudo random event" echo "Case starting..." adb shell monkey -p ${case_package_name} -v ${case_event_scale} --pct-motion 50 --pct-syskeys 30 --monitor-native-crashes current_date=`date "+%Y-%m-%d %H:%M:%S"` current_msg=‘Finished!‘ else current_date=`date "+%Y-%m-%d %H:%M:%S"` current_msg="WARNNING!!! No devices connected!"echo "[${current_date}]${current_msg}" > error.log fi# finished echo "[${current_date}]${current_msg}" echo "Quiting..."
推荐阅读
- win10专业版安装办法图解
- Android SQLite与ListView的简单使用
- AS: Unsupported method: AndroidProject.getPluginGeneration().
- App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Te
- 商城项目实战 | 2.2 Android 仿京东商城——自定义 Toolbar
- Android_WebServices_源代码分析
- 安卓 教你怎么使用下拉刷新
- [Android开源]一套快速高效的开发框架EasyAndroid
- GAutomator,GAutomatorview和Android SDK,Unity配置