0

I am new to Android and ADB. This is my first time trying to install Linux on an Android device. I have been stepping though this tutorial. I am at step 5, where the tutorial claims I will need to authorize USB debugging connections. I'm not sure it is accurate, when I booted, the device simply informed me that there was a USB connection.

So then, I gave the Linux command:

~$ adb devices
List of devices attached 
????????????    no permissions

So then I thought it might be a Linux permissions issue, and gave it sudo, but I still get the same gibberish.

~$ adb devices
List of devices attached 
????????????    no permissions

when I unplug the device, and run the command adb devices nothing shows up... a blank line. So it would seem ADB is detecting something.

What is this output telling me? How might I get my device recognized? Are there any additional settings I should enable for this to work? This Android device, is an Nextbook Ares 11.

2
  • 1
    possible duplicate of askubuntu.com/questions/213874/… Commented Sep 9, 2015 at 15:08
  • I don’t think its a duplicate, I’m not getting the same behaviour, in that post, sudo adb devices doesn’t yield the same thing. (read down to the bottom)
    – j0h
    Commented Sep 9, 2015 at 15:19

3 Answers 3

2

On your device, Go to Settings > About Device and repeatedly tap "Build Number" until it says you're a developer. Then go back to Settings and into Developer Options. Turn it on and check the box for USB debugging. Then Revoke USB debugging authorisations.
Now, connect your device, install its drivers if you haven't and type any ADB command. A message will popup on your device asking for authorization. Click Allow. Once you have done that, when you type adb devices it should say <device_id> device

7
  • 3
    Also you need to specify udev rules. Commented Sep 9, 2015 at 15:46
  • @daltonfury42 Could you explain, please? This worked for me, and I don't know what udev rules are :$
    – Rhaegar
    Commented Sep 9, 2015 at 16:42
  • 1
    @Rhaegar see: Configuring ADB for Nexus 4 on Ubuntu 11.10. udev is kind of the "Linux device manager". According to the linked Wikipedia article, it might be part of systemd meanwhile on systems having gone that way.
    – Izzy
    Commented Sep 9, 2015 at 17:28
  • But if the USB debugging isn't enabled already then why OP is getting "no permissions". He should get a blank line after "List of devices attached".
    – Firelord
    Commented Sep 9, 2015 at 19:06
  • 1
    No it doesn't. If USB debugging is disabled then why would it say unauthorized or anything. ADB at PC should not be able to detect something. Unauthorized shows up when the keys are not yet stored in the device which happens when you've not agreed in that dialog. Also, authorization only shows up for Android 4.2.2 and above.
    – Firelord
    Commented Sep 10, 2015 at 16:50
3

Changing the USB Mode in phone did the trick for me. (I set it to File Transfer)

3
  • Out of curiosity, what was it set to when it didn't work?
    – Dan Hulme
    Commented Aug 12, 2017 at 12:41
  • It was on Charging Mode. (Android 7.1.2). Spent 10-15 min trying different solutions, and finally the solution was simple.
    – NuttLoose
    Commented Aug 13, 2017 at 15:16
  • It worked! You saved me hours of stupid answers!! Tried on Android 9, Xiaomi Mi A2.
    – FonzTech
    Commented Jun 19, 2019 at 15:29
2

There are a number of reasons this can happen, most can be solved by following instructions of the official guide:

  1. You didn't enabled USB Debug in your device (do it, see guide above / other answer)
  2. Your device is USB Mode, try changing it (a notification pop up / you find a menu in the developer setting)
  3. 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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .