Created
December 17, 2020 04:12
-
-
Save tiiime/d705ae0403a0baaff7a4c78b4020bfa6 to your computer and use it in GitHub Desktop.
get current running app log
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
while [[ $# -gt 0 ]] | |
do | |
key="$1" | |
case $key in | |
-c) | |
adb logcat -c | |
shift | |
;; | |
*) | |
esac | |
shift | |
done | |
CURRENT_APP=$(adb shell dumpsys activity recents | grep 'Recent #0' | cut -d= -f2 | sed 's| .*||' | cut -d '/' -f1) | |
echo $CURRENT_APP | |
adb logcat $1 --pid=$(adb shell pidof -s $CURRENT_APP) | lnav |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment