Skip to content

Instantly share code, notes, and snippets.

@isao
Last active February 2, 2016 03:13
Show Gist options
  • Save isao/c742a5e8d76ad653ad89 to your computer and use it in GitHub Desktop.
Save isao/c742a5e8d76ad653ad89 to your computer and use it in GitHub Desktop.
adb logcat by process name
#!/bin/sh -eu
# https://gist.github.com/isao/c742a5e8d76ad653ad89
pid=$(adb shell 'ps' 2>&1 | grep com.ericsson.mediaroom.tv3client | awk '{print $2}')
if [[ -z $pid ]]
then
echo 'No process matching "com.ericsson.mediaroom.tv3client"'
exit 1
fi
adb logcat -v threadtime | grep " $pid " > "logcat-$(date +%Y%m%d-%H%M).txt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment