How can I erase the old data from logcat?

AndroidAndroid EmulatorLogcat

Android Problem Overview


When I execute the command

adb logcat

while running the android emulator, all of the old logs blow past and so I figure they are stored in a file somewhere. Is there a command I can run to clear the logs and start fresh? If not, is there some other way to do this?

Android Solutions


Solution 1 - Android

Solution 2 - Android

adb logcat -c 

didn't do it for me

adb logcat -b all -c

worked

Solution 3 - Android

Dup of https://stackoverflow.com/questions/3315389/how-to-empty-clear-the-logcat-buffer-in-android/47686978#47686978

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 

Solution 4 - Android

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionaaronaView Question on Stackoverflow
Solution 1 - AndroidPentium10View Answer on Stackoverflow
Solution 2 - AndroidBobView Answer on Stackoverflow
Solution 3 - AndroidLava SangeethamView Answer on Stackoverflow
Solution 4 - AndroidTarun Deep AttriView Answer on Stackoverflow