Android ADB command to get the application specific log in command prompt of windows

喜你入骨 提交于 2020-01-07 05:03:12

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/26257292/android-adb-command-to-get-the-application-specific-log-in-command-prompt-of-win

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!