一个简单的批处理(获取返回字符串并比较,找到指定字符串后退出)

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

posted @ 2014-12-31 11:13  绿色的麦田  阅读(1404)  评论(0编辑  收藏  举报