当我只有一台设备在运行时,我无法让logcat清除它有效但当我有两台设备时它无法正常工作。我每隔5分钟运行一次脚本,并希望清除日志,以便每次创建的日志文件都用于特定的测试运行。
logcat -c
是清除它的命令,但它似乎无法正常工作
任何想法?
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