3
# The "adb shell" command doesn't return an error if the command you execute
4
# resulted in an error. This is a wrapper to return the command's true return code.
6
# NOTE: This script uses some specific bash'isms to keep things short and simple
10
pat='ADB_RC=([[:digit:]]+)'
13
if ! adb shell "$* ; echo ADB_RC=\$?" ; then
15
adb shell "$* ; echo ADB_RC=\$?"
17
} | while read line; do
19
if [[ $line =~ $pat ]] ; then