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