Summary: Android apps can use multiple processes (eg, chrome), which are identified as <package_name>:<process_name> in logs. The names are defined in the manifest. The main process is referred to as simply <package_name> by android. Add the ability to specify a target process as part of what was until now the package name in pidcat, or all processes if no process is specified. Usage: * pidcat <package_name> will match all of an app's processes (catchall). * pidcat <package_name>:<process_name> will match a given named process. ** In particular, pidcat <package_name>: will ensure only the app's main/default process is matched. Test Plan: Run the script, try out with no process, empty (aka default) process, named process. Try multiple entries.
PID Cat
An update to Jeff Sharkey's excellent logcat color script which only shows log entries for processes from a specific application package.
During application development you often want to only display log messages coming from your app. Unfortunately, because the process ID changes every time you deploy to the phone it becomes a challenge to grep for the right thing.
This script solves that problem by filtering by application package. Supply the target package as the sole argument to the python script and enjoy a more convenient development process.
pidcat com.oprah.bees.android
Here is an example of the output when running for the Google Plus app:
Install
Get the script:
-
OS X: Use Homebrew.
brew install pidcat -
Others: Download the
pidcat.pyand place it on your PATH.
Make sure that adb from the Android SDK is on your PATH. This script will
not work unless this is that case. That means, when you type adb and press
enter into your terminal something actually happens.
To include adb and other android tools on your path:
export PATH=$PATH:<path to Android SDK>/tools
Include that line in your .bashrc or .zshrc.
