1 #!/bin/bash 2 set -e -o pipefail 3 4 # Run a command on the target Android device. 5 # 6 # Usage: target_sh <cmd> <args>... 7 8 target="$1" 9 shift 10 11 exitcode="$(target_tmpdir)/exitcode" 12 adb_${target} shell "$*; echo -n \$? > ${exitcode}" | sed -e 's:\r$::' -u 13 exit $(adb_${target} shell "cat ${exitcode}") 14