zoukankan      html  css  js  c++  java
  • 批处理脚本+adb命令(二)

    目的:

    测试中发现一个概率性问题,难以复现,使用脚本替代手工后,下班后操作第二天查看结果

    脚本如下:

    @echo off
    set var=0
    rem ************循环开始了
    :continue
    set /a var+=1
    echo 第%var%次循环
    echo 启动
    adb shell input tap 800 200
    ping 127.0.0.1 -n "10"
    echo 拍照
    adb shell input tap 800 2200
    ping 127.0.0.1 -n "2"
    adb shell input tap 800 2200
    ping 127.0.0.1 -n "2"
    adb shell input tap 800 2200
    ping 127.0.0.1 -n "2"
    echo 返回后台
    adb shell input keyevent 3
    ping 127.0.0.1 -n "10"
    echo 启动
    adb shell input tap 800 200
    ping 127.0.0.1 -n "10"
    echo 进入关于界面
    adb shell input tap 0 0
    ping 127.0.0.1 -n "2"
    adb shell input tap 100 1000
    ping 127.0.0.1 -n "10"
    echo 返回实时界面
    adb shell input tap 0 0
    ping 127.0.0.1 -n "10"
    echo 截图保存到本地
    adb shell /system/bin/screencap -p /sdcard/jietu/%var%_screenshot.png
    adb pull /sdcard/jietu/%var%_screenshot.png C:/jietu/%var%_screenshot.png
    ping 127.0.0.1 -n "3"
    echo 退出
    adb shell am force-stop com.parts.mobileir.mobileirparts
    ping 127.0.0.1 -n "3"
    if %var% lss 500 goto continue
    rem ************循环结束了
    echo 循环执行完毕
    pause

  • 相关阅读:
    搭建ip代理池思想
    maven中央仓库
    git 基本操作
    利用阿里云发送信息
    Ubuntu配置java环境
    mysql 配置
    Quartz中的时间配置
    如何在Maven中配置Spring依赖
    Jquery动态添加/删除表格行和列
    改行做窗纱批发了(浙江绍兴柯桥窗纱)
  • 原文地址:https://www.cnblogs.com/lhm-test/p/10880811.html
Copyright © 2011-2022 走看看