2013-06-11 22:59:50 -07:00
|
|
|
PID Cat
|
|
|
|
|
=======
|
|
|
|
|
|
|
|
|
|
An update to Jeff Sharkey's excellent [logcat color script][1] 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
|
2013-06-11 23:30:21 -07:00
|
|
|
target package as the sole argument to the python script and enjoy a more
|
2013-06-11 22:59:50 -07:00
|
|
|
convenient development process.
|
|
|
|
|
|
2014-03-11 20:21:19 -07:00
|
|
|
pidcat com.oprah.bees.android
|
2013-06-11 22:59:50 -07:00
|
|
|
|
|
|
|
|
|
2013-06-11 23:17:08 -07:00
|
|
|
Here is an example of the output when running for the Google Plus app:
|
2013-06-11 22:59:50 -07:00
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
2014-03-11 20:21:19 -07:00
|
|
|
Install
|
|
|
|
|
-------
|
|
|
|
|
|
2014-03-11 22:45:41 -07:00
|
|
|
Get the script:
|
|
|
|
|
|
2014-03-11 20:21:19 -07:00
|
|
|
* OS X: Use [Homebrew][2].
|
|
|
|
|
|
|
|
|
|
brew install pidcat
|
|
|
|
|
|
2015-04-24 16:26:39 +02:00
|
|
|
If you need to install the latest development version
|
|
|
|
|
|
2020-07-17 19:57:23 +05:30
|
|
|
brew unlink pidcat
|
2015-04-24 11:31:02 +02:00
|
|
|
brew install --HEAD pidcat
|
2020-07-17 19:57:23 +05:30
|
|
|
|
2017-06-04 19:12:02 +01:00
|
|
|
* Arch Linux : Install the package called `pidcat-git` from the [AUR][4].
|
2020-07-17 19:57:23 +05:30
|
|
|
|
2014-03-11 20:21:19 -07:00
|
|
|
* Others: Download the `pidcat.py` and place it on your PATH.
|
|
|
|
|
|
|
|
|
|
|
2014-03-11 22:45:41 -07:00
|
|
|
Make sure that `adb` from the [Android SDK][3] 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.
|
|
|
|
|
|
2014-03-12 11:51:27 -04:00
|
|
|
To include `adb` and other android tools on your path:
|
|
|
|
|
|
2014-03-13 07:45:54 +01:00
|
|
|
export PATH=$PATH:<path to Android SDK>/platform-tools
|
2014-03-12 11:51:27 -04:00
|
|
|
export PATH=$PATH:<path to Android SDK>/tools
|
|
|
|
|
|
2014-03-13 07:47:18 +01:00
|
|
|
Include these lines in your `.bashrc` or `.zshrc`.
|
2013-06-11 22:59:50 -07:00
|
|
|
|
2016-04-12 22:21:18 -05:00
|
|
|
*Note:* `<path to Android SDK>` should be absolute and not relative.
|
2013-06-11 22:59:50 -07:00
|
|
|
|
2020-07-17 19:57:23 +05:30
|
|
|
`pidcat` requires at least version 8.30 of `coreutils`. Ubuntu 20.04 LTS already ships
|
|
|
|
|
with it, for 18.04 and below, `coreutils` can be upgraded from the `focal` repo by running
|
|
|
|
|
the following:
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse'
|
|
|
|
|
sudo apt-get update
|
|
|
|
|
sudo apt-get -t focal install coreutils
|
|
|
|
|
```
|
|
|
|
|
|
2013-06-11 23:17:08 -07:00
|
|
|
[1]: http://jsharkey.org/blog/2009/04/22/modifying-the-android-logcat-stream-for-full-color-debugging/
|
2014-03-11 20:21:19 -07:00
|
|
|
[2]: http://brew.sh
|
2014-03-11 22:45:41 -07:00
|
|
|
[3]: http://developer.android.com/sdk/
|
2017-06-04 19:12:02 +01:00
|
|
|
[4]: https://aur.archlinux.org/packages/pidcat-git/
|