Linux adb no permissions

Getting «. » and no permissions when using ‘adb devices’ on Linux

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:

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

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.

3 Answers 3

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

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

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:

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:

if the plugdev is not listed add yourself:

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:

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

inside it write this:

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==»d001|4ee7″

Читайте также:  Linux как узнать процесс занимающий порт

Step 5: restart udev to make your changes be read

Step 6: unplug / replug your device

Источник

adb no permissions on Ubuntu 17.04

i get the result:

what is the problem?

tried on an Ubuntu 16.04 machine and it worked perfectly. tried an 7.1.1 device and it also worked perfectly.

14 Answers 14

Had same problem. Ensuring that device USB mode is NOT charging only has solved it.

Try to restart the Adb server.

then connect your device turn Debugging on and type

Very likely udev is incorrectly adding your device. I too had this problem & came across a relatively simple solution.

Find your device in lsusb

Point of interest in this case:

Check out the corresponding device file

Likely you will see something like

This which means that the device file will be owned by the user root and the group root, which is why adb can access it as root but not as your standard user.

This can be solved by creating a new udev rule — I used /etc/udev/rules.d/51-android.rules — to add the device to the group plugdev , which adb already assumes you to be a member of (you shoukd be, check using id )

**Remember to replace the ATTR==»4ee7″ with your own product id that you found out in step one. ** (If your vendor isn’t Google Inc., also replace the vendor id with the one before the colon in lsusb).

Now just unplug your device and plug it back in (udev should automatically respond to the new file) and tadaa:

Источник

Android Debug Bridge (adb) device — no permissions [duplicate]

I have a problem connecting HTC Wildfire A3333 in debugging mode with my Fedora Linux 17. Adb says:

my udev rules (first rule for Samsung which works just fine and second for HTC which is not):

For Samsung devices everything’s okay:

I have been trying all of the answers given in a simmilar thread wthout any luck: Using HTC wildfire for android development

20 Answers 20

I just had this problem myself under Debian Wheezy. I restarted the adb daemon with sudo:

Everything is working 🙂

The cause of that problem has to do with system permissions (thanks @ IsaacCisneros for this suggestion). Somehow HTC Wildfire (and maybe the others) need something more from the system than Samsung devices. Simple solution is to run Eclipse as a root, but this is not very comfortable with non-sudo Linux systems like Fedora.

I’ve found another way of achieving the same goal, which seems to be more user friendly and is lesser security hole then running entire IDE with super user privileges. Mind this is still only a workaround of the problem. System root usage should be minimalized only to administrative tasks, and “adb” was designed to work with normal user account without SUID. Despite of the fact that the proper setting of SUID is quite secure, every single permission increase is a potential system security hole.

1.Setting ownership of the adb binary (owner – root, owner group — user_group):

chown root:user_group adb

2.Setting permissions with SUID:

This should result something similar to this (ls -llh):

-r-sr-x—. 1 root user_name 1.2M Jan 8 11:42 adb

After that you will be able to run adb as a root, event though you’ll be using your normal user account. You can run Eclipse as a normal user and your HTC should be discovered properly.

I have a similar problem:

Investigation

If I run lsusb , I can see which devices I have connected, and where:

This is showing my Samsung Galaxy S3 and my Nexus 7 (2012) connected.

Checking the permissions on those:

Wait. What? Where did that «plugdev» group come from?

(I’ve wrapped those lines)

Note the GROUP=»plugdev» lines. Also note that this doesn’t work for the other device ID:

(nothing is returned)

Fixing it

OK. So what’s the fix?

Add a rule

Create a file /etc/udev/rules.d/99-adb.rules containing the following line:

This should be a single line, I’ve wrapped it here for readability

Читайте также:  Раздвижные окна sliding windows

Restart udev

That’s it

Unplug/replug your device.

Try it

You udev rule seems wrong. I used this and it worked:

( ATTR instead of SYSFS )

under ubuntu 12.04, eclipse juno. I face the same issue. This what I found on Yi Yu Blog

The solution is same as same as Leon

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

Stephan’s answer works (using sudo adb kill-server), but it is temporary. It must be re-issued after every reboot.

For a permanent solution, the udev config must be modified:

Witrant’s answer is the right idea (copied from the official Android documentation). But it’s just a template. If that doesn’t work for your device, you need to fill in the correct device ID for your device(s).

Find your android device in the list.

Then use the first half of the ID (4 digits) for the idVendor (the last half is the idProduct, but it is not necessary to get adb working).

sudo vi /etc/udev/rules.d/51-android.rules and add one rule for each unique idVendor:

It’s that simple. You don’t need all those other fields given in some of the answers. Save the file.

Then reboot. The change is permanent. (Roger shows a way to restart udev, if you don’t want to reboot).

. the OP’s own answer is wrong in so far, that there are no “special system permissions”. – The “no permission” problem boils down to . no permissions.

Unfortunately it is not easy to debug, because adb makes it a secret which device it tries to access! On Linux, it tries to open the “USB serial converter” device of the phone, which is e.g. /dev/bus/usb/001/115 (your bus number and device address will vary). This is sometimes linked and used from /dev/android_adb.

lsusb will help to find bus number and device address. Beware that the device address will change for sure if you re-plug, as might the bus number if the port gets confused about which speed to use (e.g. one physical port ends up on one logical bus or another).

An lsusb-line looks similar to this: Bus 001 Device 115: ID 4321:fedc bla bla bla

lsusb -v might help you to find the device if the “bla bla bla” is not hint enough (sometimes it does neither contain the manufacturer, nor the model of the phone).

Once you know the device, check with your own eyes that ls -a /dev/bus/usb/001/115 is really accessible for the user in question! Then check that it works with chmod and fix your udev setup.

PS1: /dev/android_adb can only point to one device, so make sure it does what you want.

PS2: Unrelated to this question, but less well known: adb has a fixed list of vendor ids it goes through. This list can be extended from

/.android/adb_usb.ini, which should contain 0x4321 (if we follow my example lsusb line from above). – Not needed here, as you don’t even get a “no permissions” if the vendor id is not known.

I’ll prepend this postscript here at the top so it won’t get lost in my earlier explanation.

I can reliably produce and resolve the no-permissions problem by simply changing the USB connection type from Camera (PTP) to Media device (MTP). The camera mode allows debugging; the media mode causes the no-permissions response in ADB.

The reasoning seems pretty evident after reflecting on that for a moment. Unsecured content on the device would be made accessible by the debugger in media server mode.

The device is unpermissioned until you accept the RSA encryption warning on the debugged device. At some point after connecting, the device will ask to accept the debugging connection. It’s a minimal security protocol that ensures you can access the device beyond the initial swipe lock. Developer mode needs to be enabled, I believe.

The «no permissions» flag is actually a good first indicator that adb recognizes the device as a valid debugging target. Notice that it doesn’t list your other USB devices.

Читайте также:  Установка мфу samsung linux

Details at the following and related pages.

Same problem with Pipo S1S after upgrading to 4.2.2 stock rom Jun 4.

All of the above suggestions, while valid to get your usb device recognised, do not solve the problem for me. (Android Debug Bridge version 1.0.31 running on Mint 15.)

Updating android sdk tools etc resets

To recognise Pipo VendorID 0x2207 do these steps

Add to line /etc/udev/rules.d/51-android.rules

Then remove the adbkey files

and reconnect your device to rebuild the key files with a correct adb connection. Some devices will ask to re-authorize.

Had the same issue. It was a problem with udev rules. Tried a few of the rules mentioned above but didnot fix the issue. Found a set of rules here, https://github.com/M0Rf30/android-udev-rules. Followed the guide there and, voila, fixed.

I encountered the same problem today.

I followed the official instructions, but I didn’t noticed that I SHOULD run command
«chmod a+r /etc/udev/rules.d/51-android.rules»

After I set this file to world readable and re-plug my usb cable,the status became unauthorized. Then just grant the permission and everything goes fine.

I agree with Robert Siemer and Michaël Witrant. If it’s not working, try to debug with strace

In my case it helps to kill all instances and remove socket file /tmp/ADB_PORT (the default is /tmp/5037 ).

Another possible source of this issue is USB tethering. If you have used USB tethering, turn it off, then unplug the device from USB, plug it back in, then do

That did the trick in my case (Ubuntu 12.04, Nexus S, SDK in home dir, never needed root to get it running). Depending on your device, you may need to run adb devices as root, though.

Try «android update adb» command. It helps me with samsung galaxy gear.

The output of ls -al /usr/bin/adb should show that it is owned by user root and group root . You can use Linux ACL (Access Control Lists) to give your local user permissions for adb as follows:

setfacl -m «u:userName:rwx» /usr/bin/adb

This is preferable to setting the SUID bit on /usr/bin/adb and also limits the users who can use adb to userName and root.

The answer is weaved amongst the various posts here, I’ll so my best, but it looks like a really simple and obvious reason.

1) is that there usually is a «user» variable in the udev rule some thing like USER=»your_user» probably right after the GROUP=»plugdev»

2) You need to use the correct SYSFS==”####″ and SYSFS==»####» values for your device/s. If you have devices from more than one manufacture, say like one from Samsung and one from HTC, then you need to have an entry(rule) for each vendor, not an entry for each device but for each different vendor you will use, so you need an entry for HTC and Samsung. It looks like you have your entry for Samsung now you need another. Remember the USER=»your_user». Use ‘lsusb’ like Robert Seimer suggests to find the idVendor and idProduct, they are usually some numbers and letters in this format X#X#:#X#X I think the first one is the idVendor and the second idProduct but your going to need to do this for each brand of phone/tablet you have.

3) I havent figured out how 51-adb.rules and 99-adb.rules are different or why.

4) maybe try adding «plugdev» group to your user with «usermod -a -G plugdev your_user», Try that at your own risk, though I don’t thinks it anyriskier than launching a gui as root but I believe if necessary you should at least use «gksudo eclipse» instead.

I hope that helped clearify some things, the udev rules syntax is a bit of a mystery to me aswell, but from what I hear it can be different for different systems so try some things out, one ate a time, and note what change works.

Источник

Оцените статью