added adb serial found check

This commit is contained in:
Ivo Oliveira Capanema 2022-11-09 20:35:20 -03:00
parent c9e2104e30
commit f1f33ae197

View File

@ -5,6 +5,10 @@ set -e
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')
if [[ -n $PHONE_ADB_SERIAL_NUMBER ]]
print_message "ERROR: no suitable phone connected"
exit 1
fi
fi
print_message() {