赞
踩
背景:产品稳定后,没有特别多的bug的时候,一般用Monkey去测试应用的稳定性、健壮性(是否发生闪退,崩溃),但是使用过程中,Monkey的随机性也带来了困扰:⼿机经常会困在⼀个界⾯出不去,其他业务测试不到。网上搜索发现了:Fastboot 字节开发的稳定性工具,下面记录了它的使用方法。
将项目Fastbot-Android git到本地,下载地址:
https://github.com/bytedance/Fastbot_Androidhttps://github.com/bytedance/Fastbot_Android
1) pc端需要有安卓adb的环境,即手机连接电脑后,在cmd上输入adb devices能够查看到设备
2)将项目中的jar包和lib目录下的文件导入到测试手机,建议导到/sdcard 和/data/local/tmp/
adb push libs /data/local/tmp/
adb push fastbot-thirdpart.jar /sdcard
adb push framework.jar /sdcar
adb push monkeyq.jar /sdcard
环境准备好后,根据需求执行以下命令,参数可以自定义。
adb -s 设备号 shell CLASSPATH=/sdcard/monkeyq.jar:/sdcard/framework.jar:/sdcard/fastbot-thirdpart.jar exec app_process /system/bin com.android.commands.monkey.Monkey -p 包名 --agent reuseq --running-minutes 遍历时长 --throttle 事件频率 -v -v
参数的含义:
程序运行完后,会打印出崩溃carsh,anr 以及monkey事件的数量,如果有崩溃,可以cd 到手机/sdcard/crash-dump.log文件中查看,捕获的Anr 同时也会写入 /sdcard/oom-traces.log
文件
新增一个文件名为:max.config 在文件中写入
然后将max.config文件push到手机端/sdcard ,--throttle 参数要 >200 才会截图
adb push max.config /sdcard
未完待续
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。