When i try:
$ adb devices
i get the result:
List of devices attached
???????????? no permissions
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.
When i try:
$ adb devices
i get the result:
List of devices attached
???????????? no permissions
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.
Had same problem. Ensuring that device USB mode is NOT charging only has solved it.
Try to restart the Adb server.
and then
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 groupplugdev
, which adb already assumes you to be a member of (you shoukd be, check usingid
)**Remember to replace the ATTR{idProduct}=="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:
Source: Adding udev rules for USB debugging Android devices - Janos Gyerik
Changing the USB Mode from Phone did the trick for me. (I set it to File Transfer.)
You need to provide permission on your Android device. Go to Settings>Developer options. Try turning Usb Debugging off and then on again. Remove the cable and reconnect it. Also try deleting all saved authorizations from Developer options. It should now ask for debugging permission by a prompt on your phone. Accept it.
To expand Sumeet Deshmukh's answer, his approach does work in general - if you only want to use the
adb
command from console.Android Studio, however, apparently starts its own adb server, killing ours. This means that after we have killed/started the server with sudo, Studio restarts it, which leads to the starting situation - no permissions.
The solution is to first start Studio, then perform the start/stop of the server. Doing that, I managed to get my Nexus 5X to show up as a valid run target in Studio.
This isn't the best situation (having to run commands every time you start Studio), but it does the trick in a quick and dirty way. If I find a more permanent solution, I will update this answer.
Please DO NOT follow solutions suggesting to use
sudo
(sudo adb start-server
)! This run adb as root (administrator) and it is NOT supposed to run like that!!! It's a BAD workaround!Everything running as root can do anything in your system, if it creates or modify a file can change its permission to be only used by root. Again, DON'T!
The right thing to do is set up your system to make the USER have the permission, check out this guide i wrote on how to do it properly.
It did not work for me after I added myself to the
plugdev
group and rebooted the machine just to make sure the change takes effect in all my shell sessions. I then found that there is no51-android.rules
file in/etc/udev/rules.d
and had to do the following to fix the problem:I also had to unplug and re-plug my Android device.
M0Rf30/android-udev-rules
GitHub community maintained udev-ruleshttps://github.com/M0Rf30/android-udev-rules/blob/master/51-android.rules
This is the most complete udev-rules list I've seen so far, even more than the currently recommended
sudo apt-get install android-tools-adb
on the official documentation, give it a try.Make sure you have your udev rules in place, check
/etc/udev/rules.d
You can find appropriate rules here: https://raw.githubusercontent.com/M0Rf30/android-udev-rules/master/51-android.rules
Just place them in
/etc/udev/rules.d/
, then:Now make sure adb server is not running:
Add your user to adbusers:
Now use
su $USER
(reference) so that your user actually belongs toadbusers
(check usinggroups
)And then just start adb server again:
In case your device does not appear in
adb devices
, reconnect it.