Android - 没有调试日志的 adb logcat

标签 android adb

我不想看到 adb logcat 命令的调试日志。我的手机有大量调试日志,我不想看到它们。

adb logcat --help"*:I " 将只输出信息日志,但是否有任何选项可以过滤除调试之外的所有日志。

最佳答案

来自 docs here ,当您指定日志级别过滤器时,它将显示该级别及更高级别的所有消息。级别指定为:

The tag of a log message is a short string indicating the system component from which the message originates (for > example, "View" for the view system).

The priority is one of the following character values, ordered from lowest to highest priority:

  • V: Verbose (lowest priority)
  • D: Debug
  • I: Info
  • W: Warning
  • E: Error
  • F: Fatal
  • S: Silent (highest priority, on which nothing is ever printed)

...

The following filter expression displays all log messages with priority level "warning" and higher, on all tags:

adb logcat *:W

因此,考虑到这一点,传递您提到的过滤器 *:I 将记录除 Verbose 和 Debug 日志之外的所有内容。

除非您的 Intent 是显示 Verbose 以及其他日志级别,否则我认为您不能这样做,因为指定 Verbose 包括 Verbose 之上的任何内容。

如果是这种情况,对特定标签而不是特定日志级别或两者的某种组合进行过滤可能对您有用。

关于Android - 没有调试日志的 adb logcat,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11009062/

相关文章:

Android UI 测试 : "adb shell uiautomator" throws error, "uiautomator"在 "adb shell"工作

android - 如何解决 Android ADB 主机设备中未经授权的 ADB 设备?

android - 如何让Android应用程序(电视盒)识别或访问USB网络摄像头?

android - 如何在 Kotlin 协程中使用 Sqldelight

android - 动态添加 TextView 到 Widget

Android adb推送到没有SD卡且没有root访问权限的设备中的位置

android - 如何在android中获取已安装的应用程序名称?

android - NFC:S-beam 和 Android beam 有什么区别?

android - 是否可以在 adb logcat 中清除指定的消息或行而不是全部清除?

Android adb 设备未经授权