- @echo off
- REM timelimit是半小时期限,单位是10ms
- set /a timelimit=180000
- call :getTod time_1
-
- :one
- ::adb shell input swipe 900 1000 700 1000
- adb shell input keyevent 25 %KEYCODE_VOLUME_DOWN%
- ping -n 6 127.0.0.1>nul
- goto two
-
- :two
- adb shell input keyevent 25 %KEYCODE_VOLUME_DOWN%
- ping -n 6 127.0.0.1>
- call :getTod time_2
- set /a "time_dist=time_2-time_1"
- if %time_dist% LSS 0 set /a "time_dist+=8640000"
- if %time_dist% lss %timelimit% (
- goto one
- )
- exit /b
- :getTod -- get a Time of Day value in 1/100th seconds
- :: -- %~1: out - time of day
- SETLOCAL
- set t=%time: =0%
- set /a t=((1%t:~0,2%*60+1%t:~3,2%)*60+1%t:~6,2%)*100+1%t:~9,2%-36610100
- ( ENDLOCAL & REM RETURN VALUES
- IF "%~1" NEQ "" SET %~1=%t%
- )
- GOTO:EOF
复制代码
|