Last active
December 1, 2020 19:27
-
-
Save obfusk/4ad83310af9b5c32215fd0094f4e4b49 to your computer and use it in GitHub Desktop.
quick and dirty logcat for specific package only
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| PACKAGE="$1" PIDS=() | |
| adb logcat | while read -r _date _time pid _tid _prio tag data; do | |
| data="${data#: }" | |
| if [[ "$data" =~ ^'Start proc '([0-9]+):"$PACKAGE" ]]; then | |
| PIDS+=( "${BASH_REMATCH[1]}" ) | |
| elif [[ " ${PIDS[*]} " =~ " $pid " ]]; then | |
| printf '[%-20s] %s\n' "${tag%:}" "$data" | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment