bat 语法练习——AF压测脚本

 该脚本用于对手机拍照模式和专业模式下的对焦功能进行压力测试

正常模式对焦4次+ 拍照退出  +  专业模式调节焦距1~10次 +拍照退出 为一次循环

adb root
adb remount

@ECHO off
chcp 6500
set i=1
set p=1
set m=3
set /a m=1
set /a p=0
:LOOP

::ping 127.0.0.1 - n 1 - w 10000 > nul
::And since the address does not exists, it'll wait 10,000 ms (10 seconds) and returns.
::The -w 10000 part specifies the desired timeout in milliseconds.
::The -n 1 part tells ping that it should only tries once (normally it'd try 4 times).
::The > nul part is appended so the ping command doesn't output anything to screen.

:: home键
C:\Users\Administrator\adb -s 08497192490K00B0  shell input keyevent 3
ping -n 1 127.0.0.1>nul
::C:\Users\Administrator\adb shell am start com.android.camera
C:\Users\Administrator\adb -s 08497192490K00B0   shell input tap 410  800
ping -n 1 127.0.0.1>nul

C:\Users\Administrator\adb -s 08497192490K00B0   shell input tap 250  113
ping 127.0.0.1 - n 1 - w 500 > nul

C:\Users\Administrator\adb -s 08497192490K00B0   shell input tap 80  140
ping 127.0.0.1 - n 1 - w 500 > nul

C:\Users\Administrator\adb -s 08497192490K00B0   shell input tap 400  140
ping 127.0.0.1 - n 1 - w 500 > nul

C:\Users\Administrator\adb -s 08497192490K00B0   shell input tap 80  560
ping 127.0.0.1 - n 1 - w 500 > nul

C:\Users\Administrator\adb -s 08497192490K00B0   shell input tap 400  560
ping 127.0.0.1 - n 1 - w 500 > nul

::拍照
C:\Users\Administrator\adb -s 08497192490K00B0   shell input tap 230  800
ping 127.0.0.1 - n 1 - w 3000 > nul


:: home键
C:\Users\Administrator\adb -s 08497192490K00B0   shell input keyevent 3
ping -n 1 127.0.0.1>nul


::C:\Users\Administrator\adb shell am start com.android.camera
C:\Users\Administrator\adb -s 08497192490K00B0   shell input tap 410  800
ping -n 1 127.0.0.1>nul

::专业模式修改焦距测试,测试准备,从Auto 开始测试
C:\Users\Administrator\adb -s 08497192490K00B0   shell input tap 433  731
ping 127.0.0.1 - n 1 - w 400 > nul
C:\Users\Administrator\adb -s 08497192490K00B0   shell input tap 410  426
ping 127.0.0.1 - n 1 - w 400 > nul
C:\Users\Administrator\adb -s 08497192490K00B0   shell input tap 325  680
ping 127.0.0.1 - n 1 - w 400 > nul
C:\Users\Administrator\adb -s 08497192490K00B0   shell input tap 50  600
ping 127.0.0.1 - n 1 - w 400 > nul
C:\Users\Administrator\adb -s 08497192490K00B0   shell input tap 50  600
ping 127.0.0.1 - n 1 - w 400 > nul

::回到了Auto挡位

set /a p=0
:bb
C:\Users\Administrator\adb -s 08497192490K00B0   shell input tap 340  560 
ping 127.0.0.1 - n 1 - w 400 > nul
set /a p=p+1

if %p% LSS %m% ( goto bb )
::一些操作

::拍照
C:\Users\Administrator\adb -s 08497192490K00B0   shell input tap 230  800
ping 127.0.0.1 - n 1 - w 3000 > nul

set /a m=m+1
set /a p=0
if %m% == 10 ( set /a m=1 )

if %p% GEQ 2000 ( goto cc )

set now_time=%time:~0,2%:%time:~3,2%:%time:~6,2% & set /a i=i+1 & call echo ==========Aleady run %i%  times, Current m: %m% ,Current Time: %now_time% & GOTO LOOP
:cc
rmdir /s/q  D:\logcat_shell_stress_test\adb_pull
md  D:\logcat_shell_stress_test\adb_pull
C:\Users\Administrator\adb -s 08497192490K00B0   pull data/ylog D:\logcat_shell_stress_test\adb_pull

pause 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值