180

I am getting following error log if I connect my android phone with Android Oreo OS to Linux PC

$ adb devices
List of devices attached
xxxxxxxx    no permissions (user in plugdev group; are your udev rules wrong?);
see [http://developer.android.com/tools/device.html]

I tried with the link provided by the error message but still getting same error.

5
  • 6
    I had the same issue and solved following the steps from the link. adb was installed manually and added to my path (fresh install of Linux) but I kept getting the error. I proceeded to remove it and install it again via apt install adb (Ubuntu-based distro). After that I've doubled checked that my user was, in fact, part of the plugdev group, rebooted the machine and plugged in the device again. Got the permission dialog displayed and all worked as expected without any hacking. :)
    – Mokkun
    Commented Jan 7, 2020 at 4:52
  • Just run it with sudo stackoverflow.com/a/15043526/3957754
    – JRichardsz
    Commented May 16, 2022 at 1:07
  • just do it sudo apt-get install android-sdk-platform-tools-common Commented Jun 6, 2022 at 10:00
  • 8
    sudo apt-get install -y android-sdk-platform-tools-common && sudo cp /lib/udev/rules.d/51-android.rules /etc/udev/rules.d/
    – ealfonso
    Commented Nov 20, 2022 at 2:06
  • @Mokkun comment worked like a charm on my Rpi Zero.
    – kyrlon
    Commented Aug 19, 2023 at 4:04

2 Answers 2

462

Check device vendor id and product id:

$ lsusb
Bus 001 Device 002: ID 8087:8000 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 078: ID 138a:0011 Validity Sensors, Inc. VFS5011 Fingerprint Reader
Bus 002 Device 003: ID 8087:07dc Intel Corp. 
Bus 002 Device 002: ID 5986:0652 Acer, Inc 
Bus 002 Device 081: ID 22b8:2e81 Motorola PCS 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Here my android device is Motorola PCS. So my vid=22b8 and pid=2e81.

Now create a udev rule:

$ sudo vi /etc/udev/rules.d/51-android.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", ATTR{idProduct}=="2e81", MODE="0666", GROUP="plugdev"

Now the device is good to be detected once udev rule is reloaded. So, let's do it:

$ sudo udevadm control --reload-rules

After this, again check if your device is detected by adb:

$ adb devices
List of devices attached
ZF6222Q9D9  device

So, you are done.

If it still doesn't work, unplug/replug the device.

If it still doesn't work, restart your OS.

19
  • 8
    This s/b the accepted answer.
    – Roger
    Commented Apr 18, 2019 at 16:52
  • 5
    Don't laugh, but I actually had to reboot Mint in actually for this to work, seemed that the udevadm command was being ineffective. Commented Jul 3, 2019 at 20:49
  • 37
    @HenriquedeSousa Had to unplug and plug back, which triggered "allow this computer ..." dialog on the Android device.
    – Majkeee
    Commented Aug 5, 2019 at 7:49
  • 2
    @HenriquedeSousa I had to do the same on mint. Commented Aug 30, 2019 at 9:27
  • 4
    Going through the USB / tethering settings on the device (pull down global notifications menu) and switching to File Transfer and disabling tethering worked for me. Commented Aug 7, 2020 at 15:47
235

I don't know the reason behind this issue. But a temporary fix would be to set the phone to File Transfer mode or MTP mode.

The problem with this fix is that you'll need to set the mode from charging mode to File transfer mode or MTP mode every time the cable is connected.

8
  • 4
    for some reason, this work. Change to File Tranfer mode and device asked for permission. Then adb kill-server adb start server and now my device is recognized. tks
    – cesarsicas
    Commented Dec 28, 2018 at 13:27
  • 13
    The reason this works is because it changes the pid in lsusb to one which is in your udev rules
    – Pieter
    Commented Jun 22, 2019 at 20:20
  • 1
    android 10 it worked !!!thanks Commented Nov 9, 2020 at 8:46
  • 2
    This works if you want just adb, but for fastboot to also work, you need to use the other answer. Commented Apr 14, 2021 at 18:19
  • 1
    Same issue happened with me! enabling the file transfer mode solved all sorts of trouble, Thanks! Commented Jun 20, 2022 at 7:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.