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 

你可能感兴趣的:(android,linux,windows)