There are a number of reasons this can happen, most can be solved by following instructions of the official guide:
- You didn't enabled USB Debug in your device (do it, see guide above / other answer)
- Your device is USB Mode, try changing it (a notification pop up / you find a menu in the developer setting)
- You miss the permission on the device on your Linux system: I explain what to do in this case
Whatever you do DO NOT launch adb start-server
with sudo
(some guide / answer on stack overflow suggest this). This is bad! It works cause you run the adb server as root (administrator) but this isn't supposed to run like that and could cause you other issues later.
Firt of all if you are in Ubuntu / debian check if a package named android-tools-adb
is available and install it:
sudo apt install android-tools-adb
this install a community managed list of permission for android devices (unplug / replug the device or try to reboot).
Make sure you are in the udev plugdev
group:
groups
if the plugdev
is not listed add yourself:
sudo usermod -aG plugdev $LOGNAME
sudo usermod -aG plugdev $USER
you may have to logout and re-log in for the change to take effect, check again with groups
command.
Some devices are not on the list, for example I've a Pixel 2 device which is not listed in the community maintained module. If you still get no permission this is what you have to do:
Step 1: plug your device in
Step 1: Check it is detected by your PC:
$ lsusb
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 8087:07da Intel Corp.
Bus 001 Device 003: ID 18d1:4ee7 Google Inc. <----------
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Step 3: note down the two codes you see after ID
In my example the device is the one named Google Inc., and the codes are 18d1:4ee7
, the first is the vendor ID, the second is the device model ID, these are for Google Pixel 2
Step 4: write an udev
rule for your device
sudo gedit /etc/udev/rules.d/70-android-custom-device.rules
inside it write this:
# GOOGLE PIXEL 2
ACTION=="add|change", SUBSYSTEM=="usb", \
ATTRS{idVendor}=="18d1", \
ATTRS{idProduct}=="4ee7", \
TAG+="uaccess"
Raplace your comment (GOOGLE PIXEL 2) with the name of the device, this is ignored by udev, it's only useful for an human reading the file (the #
is a comment). Then change the code for idVendor
and idProduct
with the codes for your devices.
If you have multiple devices with the same vendor you can list them all separating them with a pipe |
, example: ATTRS{idProduct}=="d001|4ee7"
Step 5: restart udev to make your changes be read
sudo service udev restart
Step 6: unplug / replug your device
it should now have the permissions