对Android设备进行反复亮屏/灭屏脚本
ScreenOnOff.bat:
@echo off
echo 请插入您的手机
adb wait-for-device
::for /L %%i in (1,1,3) do adb shell input keyevent 26
set counter=0
set max=100
:loop
echo Open Screen
adb shell input keyevent 26
call Sleep.bat ms 5000
echo Close Screen
adb shell input keyevent 26
call Sleep.bat ms 5000
if not %counter%==%max% goto loop
pause
Sleep.bat:
@echo off
if "%1"=="ms" ( goto delay_ms) else ( goto delay_sec)
:delay_ms
echo delay %2 ms
echo Wscript.Sleep WScript.Arguments(0) >%tmp%\delay.vbs
::echo %time%
cscript //b //nologo %tmp%\delay.vbs %2
::echo %time%
goto end
:delay_sec
echo delay %2 sec
ping 127.0.0.1 -n %2 1>nul
:end