0

Hi i want to get the application specific log in the command prompt of windows i tried this

Filter LogCat to get only the messages from My Application in Android?

adb -d logcat com.mycompanyname.demoapp:I *:S

But didn't work for me huge log was printing which was very difficult for me to find my app specific log.

I want to print my app specific log in command prompt.

Community
  • 1
  • 1
Rohit
  • 647
  • 14
  • 30

1 Answers1

2

The string that logcat uses for filtering by is not a package name but a TAG.

So logcat com.mycompanyname.demoapp:* won't work unless the package was compiled with its name used as the logging tag.

There is a workaround you can use with Android 7.0+ devices:

adb shell "logcat --pid=$(pidof -s com.mycompanyname.demoapp)"

This command finds out the process ID for the package and then uses it for logcat filtering.

Alex P.
  • 30,437
  • 17
  • 118
  • 169