APK errors

adb: device not found

Error text

error: no devices/emulators found
adb: device offline

Cause

The computer does not see the phone. USB debugging is off, the cable or driver is faulty, or the adb server is stuck.

Step-by-step fix

  1. Check that Developer options > USB debugging is on in the phone.
  2. Set USB mode to File transfer and try another cable or port.
  3. Run adb kill-server, then adb start-server.
  4. On Windows install the maker's USB driver; on Linux add a udev rule.
  5. If it says offline, restart the phone and grant permission again.

Example commands

adb devices -l
adb kill-server && adb start-server
lsusb                # Linux
# udev: SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666"

How to prevent it

Check the device with adb devices before you start work.

Author and license: Nibras Code