ADB Basics Android 1.0+ Risk: SAFE

Wait For Device

Blocks command line execution until a device is connected and recognized.

Command Syntax

adb wait-for-device
Generic Syntax: adb wait-for-device [transport]

Options & Parameters

Flag Description
wait-for-usb-device Wait specifically for USB device.
wait-for-local-device Wait specifically for emulator / local TCP socket.

Real-World Usage Examples

Wait for device before running script
Waits for device to become ready then prints release version.
adb wait-for-device && adb shell getprop ro.build.version.release
Output:
16