monkey小结

一、Monkey环境搭建:http://www.cnblogs.com/sylovezp/p/3623588.html

二、Monkey命令:https://blog.csdn.net/zm2714/article/details/7977930     https://blog.csdn.net/true100/article/details/52814520
    1、获取模拟器或设备列表命令:adb devices
    2、指定device来执行adb shell:adb -s devicename shell(备注:在多个device的时候,执行adb命令一般都需要用参数-s指定device)
    3、手机设备导入apk包cmd命令:
          # 切换到电脑端apk的目录下              
          d:
          # 手机端安装apk包
         adb -s 4f90091b install blgf_android_v3.0.1_branch.apk
    4、手机设备卸载apk包:
         adb -s 4f90091b uninstall com.benlai.benlaiguofang
    5、对手机端app进行测试命令:
        adb -s 4f90091b shell monkey -v -p com.benlai.benlaiguofang 500(备注:500是点击次数) 
    6、设置事件间隔命令:
       adb -s 4f90091b shell monkey -v -p com.benlai.benlaiguofang 500 -throttle 120(备注:500是点击次数,120秒是时间间隔)
    7、复现随机点击事件命令:
       adb -s 4f90091b shell monkey -v -p com.benlai.benlaiguofang -s 1534093584079 500(备注:-s后面的第1个参数指事件的seed,第2个参数指事件的count)
    8、设定事件百分百命令:
       adb -s 4f90091b shell monkey -v -p com.benlai.benlaiguofang --pct-touch 100 99(备注:占百分百的点击事件,完成99事件)

你可能感兴趣的:(自动化测试)