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

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SKIP_TOOLCHAIN_SETUP="true"
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!"