Android ADB command to get the application specifi

2019-08-29 14:36发布

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.

标签: android adb
1条回答
成全新的幸福
2楼-- · 2019-08-29 15:03

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.

查看更多
登录 后发表回答