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

  • 相关阅读:
    java基础 01
    c++11——模板的细节改进
    c++11——auto,decltype类型推导
    poj_1182 并查集
    poj_1988 并查集
    poj_1161 并查集
    poj_3067 树状数组
    poj_2182 线段树/树状数组
    poj_1190 树状数组
    动态规划
  • 原文地址:https://www.cnblogs.com/lhm-test/p/10880811.html
Copyright © 2011-2022 走看看