如何从 logcat 中删除旧数据?

当我执行命令时

adb logcat

在运行 Android 模拟器时,所有的旧日志都过去了,所以我认为它们存储在某个文件中。有没有一个命令我可以运行,以清除日志和重新开始?如果没有,还有别的办法吗?

70484 次浏览
adb logcat -c

didn't do it for me

adb logcat -b all -c

worked

Dup of How to empty (clear) the logcat buffer in Android

The following command will clear only non-rooted buffers (main, system ..etc).

adb logcat -c

If you want to clear all the buffers (like radio, kernel..etc), Please use the following commands

adb logcat -b all -c

or

adb root
adb shell logcat -b all -c

For me, adb logcat -c was not working and was giving following error :

failed to clear the 'main' log

For this, I first did :

adb shell

Than I did :

logcat -c

then exit the shell. This way I was able to clear logcat when same was not getting cleared from adb logcat -c