Android monkey 健壮性测试工具

发布时间 2023-05-31 16:21:54作者: 来了发发发
  1. 简介
    Monkey 是一个在模拟器或设备上运行的程序
    生成用户事件的伪随机流

  2. 安装
    Android SDK提供了Monkey工具
    使用移动设备

  3. 使用
    基本配置选项,例如设置事件数量
    操作约束,例如对指定的App进行测试
    事件类型和频率
    调试选项
    adb shell monkey [options]

  4. 常用命令
    adb shell monkey 100 对所有包随机
    adb shell monkey -p com.xueqiu.android 100 对指定包
    adb shell monkey -p com.xueqiu.android -s 20 80 时间种子
    adb shell monkey -p com.xueqiu.android -vv -s 20 80 详细日志
    adb shell monkey -p com.xueqiu.android --throttle 5000 100 时间延时
    adb shell monkey -p com.xueqiu.android --pct-touch 10 1000 事件百分比

    事件: --pct-touch:触摸事件,比如点击
    --pct-motion:动作事件,比如滑动(直线)
    --pct-trackball:轨迹事件,比如移动加点击,曲线滑动
    --pct-majornav:主要导航事件,比如回退按键,菜单按键