How to filter Android logcat by application?

Alexey Zakharov picture Alexey Zakharov · Sep 24, 2011 · Viewed 177.7k times · Source

How can I filter Android logcat output by application? I need this because when I attach a device, I can't find the output I want due to spam from other processes.

Answer

David Olsson picture David Olsson · Sep 24, 2011

Edit: The original is below. When one Android Studio didn't exist. But if you want to filter on your entire application I would use pidcat for terminal viewing or Android Studio. Using pidcat instead of logcat then the tags don't need to be the application. You can just call it with pidcat com.your.application

You should use your own tag, look at: http://developer.android.com/reference/android/util/Log.html

Like.

Log.d("AlexeysActivity","what you want to log");

And then when you want to read the log use>

adb logcat -s AlexeysActivity 

That filters out everything that doesn't use the same tag.