Created
November 21, 2017 09:49
-
-
Save AlvaroBrey/9bc32706193e4e571a97e8acec2d75c4 to your computer and use it in GitHub Desktop.
Wrapper for pidcat(https://github.com/JakeWharton/pidcat) that uses fzf (https://github.com/junegunn/fzf) to search for the app to log
This file contains 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
#!/usr/bin/env bash | |
PACKAGE=$(adb shell pm list packages -3 | cut -d ':' -f 2 | sort \ | |
| fzf --reverse \ | |
--preview-window right:40% \ | |
--preview "echo {} | xargs -I % curl -s -o- \"https://play.google.com/store/apps/details?id=%\" | grep -oh '<div class=\"id-app-title\" tabindex=\"0\">[^<]*</div>' | sed -r -n 's/^<.*>(.*)<.*>$/\1/p'" \ | |
) | |
if [[ ! -z "$PACKAGE" ]]; then | |
pidcat "$PACKAGE" | |
else | |
echo "No package selected" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment