public static final TAG = "Legendry Eagle";
问题:我想从命令行查看"传奇老鹰"
的日志。
我尝试过:
adb logcat -s "Legendry Eagle"
adb logcat -s <Legendry Eagle>
但仍然不起作用。
public static final TAG = "Legendry Eagle";
问题:我想从命令行查看"传奇老鹰"
的日志。
我尝试过:
adb logcat -s "Legendry Eagle"
adb logcat -s <Legendry Eagle>
但仍然不起作用。
如果您只想显示特定标签的logcat,请按照以下方式进行:
adb logcat YourTAGHere:Priority *:S
*:S
是重要的,因为它将所有其他标记设置为静音。如果我只想以详细级别跟踪我的MainActivity
标记,则语法应如下所示。
adb logcat MainActivity:V *:S
编辑:我没有找到有效过滤带空格标签的方法。LegendryEagle
运行良好,但我无法过滤掉 Legendry Eagle
。
"White Space Parameter"
来转义它们。想想move "c:\android files" "c:\my code\android files"
。这意味着你应该能够做到:adb logcat "Legendary Eagle:Priority" *:S
。我无法确认确切的情况,因为我没有任何使用空格的标签进行测试,但是这个命令可行:adb logcat "StatusBarManagerService:V" *:S
,这告诉我它是在Windows上而不是adb。 - Neptune Systemsadb logcat -s 标签名称
无法使用,你可以将 adb
的输出导入到 find
中进行过滤,例如:
adb logcat | find "关键词"
adb logcat | find "Legendry Eagle"
该命令将整个Logcat传递给DOS的find
命令,然后该命令会过滤掉包含Legendry Eagle字符串的行。
adb logcat | grep "your tag"
只会显示带有“your tag”的日志
public static final TAG = "LegendryEagle";
adb logcat -s "LegendryEagle"
查看logcat。你就能得到答案。
console.log
到 "Web Console",因此这并没有真正帮助。 - TheHippo