lin
2025-08-14 dae8bad597b6607a449b32bf76c523423f7720ed
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}")