I observed that when i use Logcat with Eclipse with ADT for Android, I get messages from many other applications as well. Is there a way to filter this and show only messages from my own application only.
regexp,AndroidStudio,logcat. Logcat provides several default filter options (Verbose, Info, Debug etc) and a simple pattern match filter, but the regex filter is the most powerful option for customizing logcat output.
pid = process ID. uid = user ID of the application that owns that process.
Use ps/grep/cut to grab the PID, then grep for logcat entries with that PID. Here's the command I use:
adb logcat | grep -F "`adb shell ps | grep com.asanayoga.asanarebel | tr -s [:space:] ' ' | cut -d' ' -f2`"
(You could improve the regex further to avoid the theoretical problem of unrelated log lines containing the same number, but it's never been an issue for me)
This also works when matching multiple processes.
On Windows you can do:
adb logcat | findstr com.example.package
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With