adb-devices
List connected Android devices
TLDR
List devices
List devices and their system info
SYNOPSIS
adb devices [-l]
PARAMETERS
-l
Lists attached devices with more details, including the transport ID. Provides device name, model, and transport ID.
DESCRIPTION
The `adb devices` command is a crucial part of the Android Debug Bridge (ADB) tool. It enumerates all Android devices and emulators currently connected to the host machine and accessible through ADB. This command is foundational for subsequent ADB operations, as it provides the serial numbers needed to target specific devices for actions like installing applications, debugging code, or transferring files. The output typically displays a list where each line contains the device's serial number and its current state (e.g., `device`, `offline`, `unauthorized`). The `device` state indicates successful ADB connection. The `offline` state means the device is not connected to ADB, while `unauthorized` indicates the user has not granted ADB access on the device (requiring USB debugging authorization prompt to be accepted). Understanding the output of `adb devices` is essential for Android developers and anyone working with ADB, as it dictates which devices are available for ADB interaction.
CAVEATS
ADB requires the Android device to have USB debugging enabled in the developer options. Also, the ADB server must be running on the host machine for this command to work. Insufficient permissions or driver issues may prevent the device from being listed.
DEVICE STATES
device: Normal operating state. ADB can communicate with the device.
offline: Device is not connected to ADB. Check USB connection, drivers, and device status.
unauthorized: ADB access has not been authorized on the device. Look for an authorization prompt on the device's screen.
no permissions: The user doesn't have permission to access the adb server. Fix the permissions or restart adb.
authorizing: The device is currently being authorized by the user.
TROUBLESHOOTING
If your device is not listed, try the following:
1. Ensure USB debugging is enabled on the device.
2. Restart the ADB server using `adb kill-server` followed by `adb start-server`.
3. Check USB drivers on your computer. Reinstall if necessary.
4. Revoke USB debugging authorizations on the device and reconnect it.
5. Make sure that ADB is properly installed in your PATH variable.
6. Ensure your Android device is set to 'File Transfer' mode when plugged in via USB.
HISTORY
ADB was created by Google as a part of the Android SDK to enable communication between development machines and Android devices. `adb devices` has been present since the initial release of ADB and has evolved to include additional features and improved device detection over time. Its core functionality, listing connected devices, remains unchanged.
SEE ALSO
adb(1)