【发布时间】:2018-07-05 10:38:09
【问题描述】:
当我使用 adb 连接到设备或模拟器时,我可以使用 adb logcat -c 清除 logcat。我面临的问题是我经常收到以下消息:
failed to clear the 'main' log
AFAIK,'main' 是一个无根缓冲区,这意味着我应该能够在没有根的情况下清除它。那么此消息的原因可能是什么?
【问题讨论】:
当我使用 adb 连接到设备或模拟器时,我可以使用 adb logcat -c 清除 logcat。我面临的问题是我经常收到以下消息:
failed to clear the 'main' log
AFAIK,'main' 是一个无根缓冲区,这意味着我应该能够在没有根的情况下清除它。那么此消息的原因可能是什么?
【问题讨论】:
您的 Android Studio 可能已经打开,请关闭它并再次运行,它应该能够清除日志。
【讨论】:
使用
adb logcat -b all -c
它将清除所有缓冲区。有时 adb logcat -c 将无法工作,因为许多进程使用它,如 android studio。
【讨论】:
logcat: failed to clear the 'events' log.
Logcat消息存储在缓冲区中,你可以试试,
adb logcat -c
清除(刷新)选定的缓冲区并退出。默认缓冲区集是 main、system 和 crash。要清除所有缓冲区,请使用 -b all -c。
来源:logcat doc
更多logcat使用请查看How do I get the logfile from an Android device?
【讨论】: