I tried all answers at How to filter Android logcat by application? but some of them only work when the app is running, or some require logging in to the device via shell.
If I run those commands before my app is running, I get the entire log output because there's no PID for my app yet. Example:
adb logcat | grep `adb shell ps | grep com.package | cut -c10-15`
requires the app to be already running, but I'm trying to debug something that happens 0.1s after the app starts and then it crashes. Also, if I restart the app, I can't see anything anymore as the PID changes.
And for some other answers, they are for a specific tag:
adb logcat ActivityManager:I MyApp:D *:S
but my app is crashing with some output, the crash does not come from a Log.d
I want to see all the Log.d calls from my app, but also the crashes and other stuff not printed by Log.d, but by my app, just as Android Studio can do somehow.