【问题标题】:How can I erase the old data from logcat?如何从 logcat 中删除旧数据?
【发布时间】:2011-02-09 02:01:23
【问题描述】:

当我执行命令时

adb logcat

在运行 android 模拟器时,所有的旧日志都会过去,所以我认为它们存储在某个文件中。有没有我可以运行的命令来清除日志并重新开始?如果没有,是否有其他方法可以做到这一点?

【问题讨论】:

标签: android android-emulator logcat


【解决方案1】:

对我来说,adb logcat -c 无法正常工作并出现以下错误:

failed to clear the 'main' log

为此,我首先做了:

adb shell

比我做的:

logcat -c

然后退出外壳。 这样,当没有从 adb logcat -c 清除 logcat 时,我就能够清除 logcat

【讨论】:

    【解决方案2】:

    复制 How to empty (clear) the logcat buffer in Android

    以下命令将仅清除非根缓冲区(main、system ..etc)。

    adb logcat -c
    

    如果要清除所有缓冲区(如收音机、内核..等),请使用以下命令

    adb logcat -b all -c
    

    adb root
    adb shell logcat -b all -c 
    

    【讨论】:

      【解决方案3】:

      【讨论】:

      • 由于某些原因,在为特定设备传递 -s 标志时没有为我清除日志。
      【解决方案4】:
      adb logcat -c 
      

      不是为我做的

      adb logcat -b all -c
      

      工作

      【讨论】:

      • 这应该是正确的答案。如果您正在分析 SELinux,则其他答案将不起作用。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-01-24
      • 2020-11-18
      • 2016-03-14
      • 2021-07-28
      • 1970-01-01
      • 1970-01-01
      • 2020-05-31
      相关资源
      最近更新 更多