项目中需要用到 Monkey 做压力测试,抽空去熟悉了下,各种命令就不废话了,官方文档有。

比如你可以用以下命令开启 Monkey 测试:

adb shell 

monkey -v -v -p com.archermind.callstat --monitor-native-crashes --ignore-security-exceptions --kill-process-after-error --pct-trackball 0 --pct-nav 0 --pct-anyevent 0 --pct-appswitch 0 --pct-flip 0 --pct-majornav 10 --pct-touch 44 --pct-motion 30 --throttle 500 6000000 > /mnt/sdcard/log/monkey_test.txt &
logcat -v time > /mnt/sdcard/log/logcat.txt

尽管 Monkey 功能强大,但它不是万能的,使用它可以测试一些ANR和Crash的问题,如果想进行功能测试,最好使用 Monkeyrunner ,这块以后用到再研究。

从测试手里搞到一个Monkey脚本,它可以循环的进行Monkey测试,不论你中间是否因为crash或ANR而停止,并且会自动生成测试的log的你的硬盘上,只要你在debug模式下连接了电脑。

相关文章:

  • 2021-06-26
  • 2021-06-04
  • 2021-11-23
  • 2021-04-20
  • 2021-10-06
  • 2022-01-09
  • 2022-01-19
猜你喜欢
  • 2021-12-19
  • 2022-12-23
  • 2021-05-21
  • 2021-09-28
  • 2021-12-04
  • 2022-03-06
  • 2022-01-08
相关资源
相似解决方案