xwords/xwords4/android/scripts/alogcat-n.sh

31 lines
537 B
Bash
Raw Normal View History

#!/bin/sh
set -u -e
INDX=1
2012-01-26 03:28:25 +01:00
PAT="."
usage() {
[ $# -ge 1 ] && echo "ERROR: $1"
2012-01-26 03:28:25 +01:00
echo "usage: $(basename $0) [-n <1-based-indx>] [-g]"
exit 1
}
while [ $# -ge 1 ]; do
case $1 in
-n) shift
[ $# -ge 1 ] || usage "-n requires a parameter"
INDX=$1
;;
2012-01-30 15:34:15 +01:00
-g) PAT="D/XW4\|D/xw4"
2012-01-26 03:28:25 +01:00
;;
*)
usage
;;
esac
shift
done
DEVICE=$(adb devices | grep 'device$' | awk '{print $1}' | sed -n "${INDX}p")
2012-01-26 03:28:25 +01:00
adb -s $DEVICE logcat | grep "$PAT"