Detecting a connected device

After connecting the device to the workstation and before issuing other ADB commands, it is helpful to know whether the Android device is properly connected to the ADB server. This can be done using the ADB devices command, which lists out all of the devices that are connected to the computer as shown in the following command lines. This would also list the emulator if it is running at the time of issuing the command:

adb devices
List of devices attached
52037762b835835b device

Remember that, if necessary drivers are not installed, then the preceding command would show a blank message. If you encounter that situation, download the necessary drivers from the manufacturer and install them.

As seen in the preceding command lines, the output contains the serial number of the device followed by the connection state. The serial number is a unique string used by ADB to identify each Android device. The possible connection state values and their meaning is explained in the following lines:

  • Offline: The instance is not connected to ADB or is not responding.
  • Device: The instance is connected to the ADB server.
  • No device: There's no device connected.
  • Unauthorized: USB debugging isn't authorized.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.218.62