Filtering Logcat Logs on commandline

前端 未结 6 1856
小鲜肉
小鲜肉 2021-02-01 01:59
public static final TAG = \"Legendry Eagle\";

Issue: I want to see logs of \"Legendry Eagle\" from the commandline.

I tried:

相关标签:
6条回答
  • 2021-02-01 02:29

    Answer is very simple . Please remove space between two words and try again.

     public static final TAG = "LegendryEagle";
     adb logcat -s "LegendryEagle" 
    

    and see the logcat . You got your answer.

    0 讨论(0)
  • 2021-02-01 02:31

    If you only want to show logcat for a specific TAG, do it like this:

    adb logcat YourTAGHere:Priority *:S
    

    The *:S is important, as it sets all other tags to silent. If I want to track only my MainActivity tag at Verbose level, the syntax would look like this.

    adb logcat MainActivity:V *:S
    

    Edit: I found no good way of filtering out tags with spaces. LegendryEagle works fine, but I was not able to filter out Legendry Eagle

    0 讨论(0)
  • 2021-02-01 02:31
    adb logcat | grep "your tag"
    

    will only display logs with "your tag"

    0 讨论(0)
  • 2021-02-01 02:43

    Assuming you are using Eagle as the logging tag, use this:

    adb logcat Eagle:* *:s

    as I understand the Eagle:* means to turn on all logs for the Eagle tag, and the *:s means to make all other tags silent

    I personally find the eclipse logcat view much easier to use than the command line, it has different colors for different levels of logs, and you can create a filter and save it, it'll stay there forever until you delete that filter

    0 讨论(0)
  • 2021-02-01 02:49

    If the standard adb logcat -s tagname doesn't work, you can always pipe the output of adb to find to filter what you need, something like

    adb logcat | find "Legendry Eagle"
    

    This passes the entire logcat to DOS find command, which in turn filters out rows containing Legendry Eagle string.

    0 讨论(0)
  • 2021-02-01 02:53

    use this command adb logcat *:W and read this. http://developer.android.com/tools/debugging/debugging-log.html

    0 讨论(0)
提交回复
热议问题