运用monkeyscript测试大致分为三个步骤:
(1)写脚本
(2)将本地脚本复制到手机里 adb push (script) /data/local/tmp
(3)启动脚本 adb shell monkey -f (script)(event-count)

脚本如下:
app压力测试小实践(3)

LaunchActivity( a , b )
两个参数:
(1)第一个为应用包名,可通过 adb shell “logcat | grep START” 这条命令获取
(2)第二个为源文件中属性设置文件 .xml 中,MainActivity的名字。前面一定要加上包名!

获取APK包名: adb shell “logcat | grep START”

app压力测试小实践(3)

如果没有打开应用,考虑原因(1)参数错误,核对XML文件 (2)没有 android:exported = “true”

将脚本复制到手机里 adb push (script) /data/local/tmp
app压力测试小实践(3)
检查脚本是否复制到手机
app压力测试小实践(3)
启动脚本进入 /data/local/tmp目录 monkey -f (script)(event-count)
app压力测试小实践(3)

===========================================================

相关文章:

  • 2022-01-26
  • 2021-12-24
  • 2021-07-18
  • 2021-05-27
  • 2021-04-13
  • 2021-09-02
  • 2022-01-14
猜你喜欢
  • 2021-06-01
  • 2021-11-13
  • 2021-04-13
  • 2021-09-30
  • 2021-10-07
  • 2021-09-08
  • 2021-09-26
相关资源
相似解决方案