ADB logcat无法清除主日志

vat*_*bub 6 android adb

当我使用adb连接到设备或模拟器时,我可以使用清除logcat adb logcat -c.我面临的问题是我经常收到以下消息:

failed to clear the 'main' log
Run Code Online (Sandbox Code Playgroud)

AFAIK,'main'是一个非root的缓冲区,这意味着我应该能够在没有root的情况下清除它.那么这个消息的原因是什么呢?

Par*_*ain 8

使用

adb logcat -b all -c 
Run Code Online (Sandbox Code Playgroud)

它将清除所有缓冲区。有时adb logcat -c将无法工作,因为许多进程使用它,例如 android studio。


小智 7

您可能打开了 Android Studio,请关闭它并再次运行,它应该可以清除日志。