aboutsummaryrefslogtreecommitdiffhomepage
path: root/platform_tools/android/bin/adb_wait_for_device
blob: f9a2b6daed1cc4f86778ac518585c96e65cb0b5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
#
# Wait for the device to be connected.

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $SCRIPT_DIR/android_setup.sh
source $SCRIPT_DIR/utils/setup_adb.sh

set -e

# Wait for the device to be connected and fully booted.
while [ "$($ADB $DEVICE_SERIAL shell getprop sys.boot_completed | tr -d '\r')" != "1" ]; do
  echo "Waiting for the device to be connected and ready."
  sleep 5
done

echo "Connected!"

$SCRIPT_DIR/adb_wait_for_charge