logcat won't clear out for multiple devices

281 views Asked by At

I can't get the logcat to clear out it worked when i had just one device running but when i have two it doesn't work. I'm running the script every 5 mins and want the log to be cleared so the log file created is for that particular test run each time.

logcat -c is the command to clear it but it doesn't seem to be working

any ideas?

cd C:\Users\nicho\android-sdks\platform-tools
adb
adb -s emulator-5554 shell logcat -c
adb -s emulator-5554 shell am instrument -w com.example.nicho.pleasework.test/android.test.InstrumentationTestRunner
set timestamp=%date:~-4,4%%date:~-7,2%%date:~-10,2%%time:~0,2%%time:~3,2%%time:~6,2%
adb -s emulator-5554 logcat -d -v time MyTest:I > "C:\Users\nicho\Desktop\logs\robotium\%timestamp%-Robotium_Em_logcat.txt"
adb -s emulator-5554 shell logcat -c
adb -s emulator-5556 shell logcat -c
adb -s emulator-5556 shell am instrument -w com.example.nicho.pleasework.test/android.test.InstrumentationTestRunner
set timestamp=%date:~-4,4%%date:~-7,2%%date:~-10,2%%time:~0,2%%time:~3,2%%time:~6,2%
adb -s emulator-5556 logcat -d -v time MyTest:I > "C:\Users\nicho\Desktop\logs\nexus4\%timestamp%-Nexus_4_logcat.txt"
adb -s emulator-5556 shell logcat -c
0

There are 0 answers