|
|
|
@ -2,6 +2,10 @@
|
|
|
|
|
|
|
|
|
|
set -e |
|
|
|
|
|
|
|
|
|
print_message() { |
|
|
|
|
printf "$1\n" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
PHONE_ADB_SERIAL_NUMBER=${ADB_DEVICE} # The adb serial number can be found by running `adb devices`. |
|
|
|
|
if [$PHONE_ADB_SERIAL_NUMBER = '']; then |
|
|
|
|
PHONE_ADB_SERIAL_NUMBER=$(echo $(adb devices) | sed -rn 's/(^|(.* ))([^ ]*) device(( .*)|$)/\3/; T; p; q') |
|
|
|
@ -11,10 +15,6 @@ if [$PHONE_ADB_SERIAL_NUMBER = '']; then
|
|
|
|
|
fi |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
print_message() { |
|
|
|
|
printf "$1\n" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
check_phone_is_connected() { |
|
|
|
|
if ! adb devices | grep --silent "$PHONE_ADB_SERIAL_NUMBER"; then |
|
|
|
|
print_message "ERROR: phone '$PHONE_ADB_SERIAL_NUMBER' is not connected" |
|
|
|
|