7

Would like to know how can I get the adb logcat of ONLY certain app, and all its errors and messages associated.

I've tried before with adb logcat -c; adb logcat | grep com.fitbit.FitbitMobile, but the thing is, it forces a grep on EVERY line, and sometimes there's a crash that involves multiline where needed information gets omitted.

I've tried the command on page Displaying and filtering with Logcat, however doesn't work. It just gets everything:

adb logcat -c && adb logcat com.fitbit.FitbitMobile:V

I've tried also the filtering option on Android Developers Documentation, but just mutes everything:

adb logcat com.fitbit.FitbitMobile:D *:S

Others commands that get the pid are not useful if the app is not running when I run logcat, and crashes immediately and is relaunched with a different pid.

Any ideas about the proper format?

6
  • 2
    There is no official but many third party solutions. I found pidcat quite good. You may give it a try. Dec 28, 2020 at 18:48
  • @IrfanLatif thanks a lot, that worked somehow!
    – Smeterlink
    Dec 28, 2020 at 21:57
  • @IrfanLatif that looks like a good alternative answer, would you post that as a proper answer?
    – Andrew T.
    May 2, 2022 at 16:29
  • I think the answer at stackoverflow.com/questions/6854127/… is ideal.
    – Bink
    Jun 8 at 21:40
  • @Bink that doesn't work, because debug info can be in multiple lines, only the header will have your.package.name.
    – Smeterlink
    Jun 10 at 6:45

1 Answer 1

0

I found a simple solution without requiring a third party app.

Just connect to the device using shell: adb shell

Then run: logcat | grep your.package.name

It will only show lines that contain that package name.

1
  • This does not work, because some information is in multiple lines and only the header includes your.package.name.
    – Smeterlink
    Jun 10 at 6:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .