| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # | 2 # |
| 3 # Wait for the device to be connected. | 3 # Wait for the device to be connected. |
| 4 | 4 |
| 5 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | 5 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
| 6 SKIP_TOOLCHAIN_SETUP="true" | 6 SKIP_TOOLCHAIN_SETUP="true" |
| 7 source $SCRIPT_DIR/android_setup.sh | 7 source $SCRIPT_DIR/android_setup.sh |
| 8 source $SCRIPT_DIR/utils/setup_adb.sh | 8 source $SCRIPT_DIR/utils/setup_adb.sh |
| 9 | 9 |
| 10 set -e | 10 set -e |
| 11 | 11 |
| 12 # Wait for the device to be connected and fully booted. | 12 # Wait for the device to be connected and fully booted. |
| 13 while [ "$($ADB $DEVICE_SERIAL shell getprop sys.boot_completed | tr -d '\r')" !
= "1" ]; do | 13 while [ "$($ADB $DEVICE_SERIAL shell getprop sys.boot_completed | tr -d '\r')" !
= "1" ]; do |
| 14 echo "Waiting for the device to be connected and ready." | 14 echo "Waiting for the device to be connected and ready." |
| 15 sleep 5 | 15 sleep 5 |
| 16 done | 16 done |
| 17 | 17 |
| 18 echo "Connected!" | 18 echo "Connected!" |
| 19 | |
| 20 $SCRIPT_DIR/adb_wait_for_charge $DEVICE_SERIAL | |
| OLD | NEW |