Filter comand line logcat by application packageName like in eclipse

12,823 views
Skip to first unread message

Tomáš Procházka

unread,
Dec 16, 2011, 6:20:24 AM12/16/11
to adt...@googlegroups.com
In eclipse is from ADT14 (I think) possible filter "by Application Name" which is Package Name (com.xyz.abc)

But how i can do the same from command line "adb logcat" or exist any standalone tools which can do this?
I need it for the testers. It does'n have Eclipse.

Mark Murphy

unread,
Dec 16, 2011, 7:26:42 AM12/16/11
to adt...@googlegroups.com
2011/12/16 Tomáš Procházka <tomas.p...@gmail.com>:

> In eclipse is from ADT14 (I think) possible filter "by Application Name"
> which is Package Name (com.xyz.abc)
>
> But how i can do the same from command line "adb logcat" or exist any
> standalone tools which can do this?

http://stackoverflow.com/questions/5933468/how-to-monitor-android-adb-logcat-and-do-a-grep
http://stackoverflow.com/questions/4044132/filter-tags-in-logcat-in-android-eclipse-plug-in
http://stackoverflow.com/questions/6323206/how-can-i-filter-out-a-tagname-using-adb-logcat

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_Android Programming Tutorials_ Version 4.1 Available!

Tomáš Procházka

unread,
Dec 16, 2011, 7:55:38 AM12/16/11
to adt...@googlegroups.com
Thanks. But it doesn answer my reply. I know how to filter via TAG, but I want to filter by "Package Name". This is the same like filter by PID, only package name is still the same, this is much better than filter via tag. But it look that ADT Team add this possibility only to Eclipse and forgot for switch in command-line tools :-(


Mark Murphy

unread,
Dec 16, 2011, 7:58:47 AM12/16/11
to adt...@googlegroups.com
2011/12/16 Tomáš Procházka <tomas.p...@gmail.com>:

> Thanks. But it doesn answer my reply. I know how to filter via TAG, but I
> want to filter by "Package Name".

Whoops, sorry, wasn't paying close enough attention.

Yuku

unread,
Dec 16, 2011, 9:05:09 AM12/16/11
to adt...@googlegroups.com

Hi,

There is a temporary solution, search the web for proclogcat script.

Then pipe the logcat as
adb logcat | proclogcat your.package.name

Yuku

Tomáš Procházka

unread,
Dec 16, 2011, 10:08:50 AM12/16/11
to adt...@googlegroups.com
Thanks. I will investigate this. I don't understand like this can work if logcat doesn contain any info about package.

Tomáš Procházka

unread,
Dec 23, 2011, 2:06:56 AM12/23/11
to adt...@googlegroups.com
It is really usefull script. Only is not possible to filter multiple process by common package name, like Eclipse can do :-(
I mean enter only "com.google" to filter all logs from all google aps.

Vipul Bhopal

unread,
Sep 3, 2013, 6:24:49 AM9/3/13
to adt...@googlegroups.com
if on linux, easiest way to make it work through shell is using this command :

adb logcat | grep `adb shell ps | grep <com.package> | cut -d" " -f2`

Jake Wharton

unread,
Sep 3, 2013, 12:06:45 PM9/3/13
to adt...@googlegroups.com
I re-wrote Jeff Sharkey's colored logcat script to do this a few months ago: https://github.com/JakeWharton/pidcat

--
You received this message because you are subscribed to the Google Groups "adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adt-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

jhle...@gmail.com

unread,
Feb 4, 2014, 7:15:01 AM2/4/14
to adt...@googlegroups.com
Thanks very useful. I love it :)

e vdsande

unread,
Jul 20, 2015, 8:48:25 AM7/20/15
to adt...@googlegroups.com
To view the logcat output in Eclipse or AndroidStudio is sometimes a real hassle because of the huge number of logmessages passing by and when you filter in logcat you loose the filtered messages and cannot recall the these anymore. What I use is logcatUDP.apk and TailExpert. With logcatUDP you sent all logcat messages to TailExpert via wifi and in TailExpert you can filter the messages you don’t want to see. For logcatUDP you need a rooted phone but you can also use adb to write your logcat messages to a file and watch this file with TailExpert. Both TailExpert and logcatUDP are free for private use and you can download both logcatUDP and TailExpert at http://tailexpert.neware.nl

Op vrijdag 23 december 2011 08:06:56 UTC+1 schreef Tomáš Procházka:

e vdsande

unread,
Dec 25, 2015, 9:38:08 AM12/25/15
to adt-dev
The latest version of TailExpert supports automated processId to processname translationfor adb logcat views which makes it possible to filter on packagenames in logcat logs just like in eclipse and androidstudio
Reply all
Reply to author
Forward
0 new messages