echo ====adb root 开始======
goto ROOT
:ROOT
adb root
goto JUDGE
:JUDGE
adb devices|findstr /e device
if %errorlevel% EQU 0 (
echo ===find devices --[device]
echo ====adb root 成功device======
goto STARTGETLOG
)
adb devices|findstr /e recovery
if %errorlevel% EQU 0 (
echo ===find devices --[recovery]
echo ====adb root 成功recovery======
goto STARTGETLOG
)
echo ====2s后重新 adb root======
call :Delay 2
goto ROOT
:Delay
echo ===delay %1 seconds...
ping -n %1 127.0.0.1 > __null__
del __null__
goto:eof
:STARTGETLOG
echo ====开始抓取log ======
start logcat_event.bat
start logcat_main.bat
start logcat_sys.bat
start logcat_crash.bat
start logcat_radio.bat
logcat_main.bat内容如下:
del C:\Users\Administrator\Desktop\log\main.log
echo ====get main======
adb logcat -v threadtime -b main > C:\Users\Administrator\Desktop\log\main.log
adb root
adb remount
adb shell monkey -p com.android.contacts -v -v -s 100 --throttle 200 --ignore-crashes --monitor-native-crashes --ignore-timeouts 5000000 > F:\log\monkey.log