处理logcat中的空间

Rol*_*n_s 13 android logcat

我的应用程序使用的其中一个外部库在其logcat标记中包含空格:

Log.d("Some External Library", "Debug Message");
Run Code Online (Sandbox Code Playgroud)

如何在logcat命令中编写filter-spec来处理空格?Eclipse中的Logcat能够过滤它,但我更喜欢命令行.

我尝试了以下内容但它们不起作用:

adb logcat -s "Some External Library"
adb logcat -s Some\ External\ Library
adb logcat -s Some External Library
Run Code Online (Sandbox Code Playgroud)

Dar*_*har 7

所以我的建议是使用管道.写:

adb logcat | grep 'Some External Library'
Run Code Online (Sandbox Code Playgroud)

也许别人有另一个想法.

如果只需要调试消息,则写入adb logcat '*:D' | grep 'Some External Library'更多可能的标记写入adb logcat --help

问题是,您无法在adb shell环境中使用此解决方案,因为文件系统是只读的.但是这个解决方案应该给你或多或少的结果.

诸如adb logcat -s'Some External Library'之类的命令或者logcat -s '"Some External Library":D' 不起作用.