一个简单的批处理(获取返回字符串并比较,找到指定字符串后退出)
cd /d "%~dp0"
cd /d "%cd%\"
start test.exe
:First_label
ping -n 1 127.0.0.1>nul
adb connect 127.0.0.1:6555|findstr /I /c:"already connected"
@echo %errorlevel%
if %errorlevel% == 1 GOTO First_label
ping -n 1 127.0.0.1>nul
adb connect 127.0.0.1:6555|findstr /I /c:"already connected"
del Log\1.log
adb logcat > Log\1.log
pause