Search code examples
androidadb

When should I see 'no device' output when running 'adb devices'?


The adb documentation says that when you issue the adb devices command, you get back the state for each device: https://developer.android.com/studio/command-line/adb.html#devicestatus

The connection state of the device can be one of the following: offline, device, no device

When I run adb devices without any device connected to my machine, I get this empty result:

$adb devices

List of devices attached

My question is, under what circumstances can I see the no device state when issuing the adb devices command? Since if there are no devices, I simply get an empty output, but no no device output. The documentation is not clear to me at this part.

Edit:
I am asking this question, because one can also get for example 'unauthorized' state, even though the documentation says nothing about it. So I was curious about this so-called 'no device' state, whether it is a real state, etc.


Solution

  • Not sure if this helps, but one can inspect enough of the adb code in a Hex or Text editor to see hard-coded strings.

    There are only a handful of instances of no devices, but nothing that says "no device"

    Also highlighted unauthorized, which does seem like a conditional when kick_func_ != null

    emulators found�no devices/emulators foundno devices foundmore than one device�more than one emulator�more than one device/emulator�device unauthorized.
    �ADB_VENDOR_KEYS�This adb server's $ADB_VENDOR_KEYS is �not set�Try 'adb kill-server' if that seems wrong.
    �Otherwise check for a confirmation dialog on your device.�device offline�success�Check failed: kick_func_ != nullptr�offline�unauthorized