Skip to content

Instantly share code, notes, and snippets.

@flocsy
Created August 5, 2014 18:47
Show Gist options
  • Save flocsy/44ec95de934048975738 to your computer and use it in GitHub Desktop.
Save flocsy/44ec95de934048975738 to your computer and use it in GitHub Desktop.
#!/bin/sh
PACKAGE=$1
APPPID=`adb -d shell ps | grep "${PACKAGE}" | cut -c10-15 | sed -e 's/ //g'`
adb -d logcat -v long \
| tr -d '\r' | sed -e '/^\[.*\]/ {N; s/\n/ /}' | grep -v '^$' \
| grep " ${APPPID}:"
@flocsy
Copy link
Author

flocsy commented Aug 5, 2014

Use it to list the logcat of an app/package from your android device:

applog.sh <com.example.package.name>

@qx
Copy link

qx commented Nov 6, 2014

not work,have you tested?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment