A fork of JakeWharton/pidcat, with the following PRs merged (and a bit of refactoring):
- #187: Added setup.py (by JamesConlan96)
- #189: New -m REGEX to filter by message (by johnnylambada)
- #188: fix print encode non utf 8 strings (by michael2to3)
- #179: Fix Issue #178 and bump version to 2.1.1 (by ozziefallick)
- #174: Fixes #165 (by ramanr1)
- #166: Add alternate buffer argument, fixes (#128) (by michalkielan)
- #152: Handle processes with : format (by nickpalmer)
- #145: Fix blank line cause silent quit. (by nomadalex)
- #135: Add option --proguard-mapping to interpret class names correctly when using proguard (by fcamel)
- #133: Set terminal title to current device/emulator name. (by colriot)
- #131: --colorized argument added for colorized log messages (by faruktoptas)
- #121: Handle case when passing --current with no running application (by tokou)
- #119: fix bash completion of package names for the filter arg (by eighthave)
- #118: Add timestamps to each message (by vibhavsinha)
- #115: Feature : Global ignore list (Issue #79) (by xgouchet)
- #108: Colorization on Windows using colorama (by oakkitten)
- #100: add support for reading arguments from config files (by ayvazjmm)
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:
Get the script:
-
OS X: Use Homebrew.
brew install pidcat
If you need to install the latest development version
brew unlink pidcat brew install --HEAD pidcat
-
Arch Linux : Install the package called
pidcat-git
from the AUR. -
Others: Download the
pidcat.py
and 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.
On Windows, you can do pip install colorama
if you see weird arrows instead of
colors. In case that does not help, try using option -f
.
To include adb
and other android tools on your path:
export PATH=$PATH:<path to Android SDK>/platform-tools
export PATH=$PATH:<path to Android SDK>/tools
Include these lines in your .bashrc
or .zshrc
.
Note: <path to Android SDK>
should be absolute and not relative.
Arguments can be specified at the command line or in one of the following config files: ~/.pidcat.conf or ./.pidcat.conf
cat ~/.pidcat.conf
--min-level=D
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:
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