set up device for development (???????????? no permissions)
Asked Answered
L

31

299

I am using a Samsung galaxy nexus phone (Android 4.0 platform) .

I am developing Android app on Ubuntu linux OS. I would like to run my application directly on the Samsung handset device, so I performed the following setup steps:

  1. in my project AndroidManifest.xml file, added android:debuggable="true" to the <application> element

  2. On the device, in the Settings > Security enabled Unknown sources

  3. On the device, in the Settings > Developer options enabled USB debugging

  4. On my computer, created the /etc/udev/rules.d/51-android.rules file with the following content:

    SUBSYSTEM=="usb", ATTR{idVendor}=="04E8", MODE="0666", GROUP="plugdev" 
    
  5. On my computer, run the chmod a+r /etc/udev/rules.d/51-android.rules command

Then, on my computer I opened a terminal and executed the adb devices command, I got:

List of devices attached 
????????????    no permissions

Since I did not see my device but only ???????????? no permissions, I then run the following commands:

 adb kill-server
 adb start-server
 adb devices

But I still got:

List of devices attached 
????????????    no permissions

Why? What am I missing?

Locally answered 9/2, 2012 at 11:35 Comment(5)
after exectuing adb kill-server did u get the message that * daemon not running. starting it now on port 5037 * * daemon started successfully * --- if not try it till u get this msgRejoice
Try to check that your user is in plugdev group.Impression
Run =>sudo adb start-server (Use root access to run adb)Vidovic
finally i found the solution which worked for me in this link github.com/snowdream/51-androidHazzard
please see my 2022 update to this problem wayyy down below and a quick comment that some of the really old solutions here can brick a linux system.Parterre
C
479

What works for me is to kill and start the adb server again. On linux: sudo adb kill-server and then sudo adb start-server. Then it will detect nearly every device out of the box.

Clothes answered 9/2, 2012 at 11:55 Comment(8)
I use root to execute command "adb devices" under <android-SDK>/platform-tool/ , I got "No command 'adb' found", why?Locally
could you paste the exact command you use? I use sudo /opt/android/platform-tools/adb devicesClothes
I use the same syntax command. "sudo /PATH_TO_ANDROID_SDK/platform-tolls/adb devices" It does not helpLocally
make sure that your adb got +x -rwxrwxr-x 1 martin martin 156K 2011-11-09 15:40 adb. Try to move to the directory directly and start via "sudo ./adb devices". If you can run that without sudo, you should be able to run it with sudo... I am not sure what your issue might be...Clothes
You should not need to run adb as root if your udev permissions are set correctly. See grebulons answer below, or reference the android documentation: developer.android.com/tools/device.htmlShipe
Probably, but why maintaining a list if you could just use root? I have zero interest in adding a rule to it just because I test on a different device. If you just use one, no problem but with a laptop running around on conferences or with a huge amount of devices at work? No thank you.Clothes
One important suggestion is disconect the usb cable, so you reset adb, conect the cable and it works. In my situation, while I did the procedure with the cable connected it does not work for me.Baloney
And the commands are: adb kill-server sudo adb start-server to check: adb devicesApiculate
M
360

Nothing worked for me until I finally found the answer here: http://ptspts.blogspot.co.il/2011/10/how-to-fix-adb-no-permissions-error-on.html

I'm copying the text here in case it disappears in the future.

Create a file named /tmp/android.rules with the following contents (hex vendor numbers were taken from the vendor list page):

SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0e79", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0502", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0b05", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="413c", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0489", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="091e", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="24e3", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2116", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0482", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="17ef", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1004", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="22b8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0409", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2080", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0955", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2257", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="10a9", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1d4d", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0471", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04da", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="05c6", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1f53", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04dd", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0930", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="19d2", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1bbb", MODE="0666"

Run the following commands:

sudo cp /tmp/android.rules /etc/udev/rules.d/51-android.rules
sudo chmod 644   /etc/udev/rules.d/51-android.rules
sudo chown root. /etc/udev/rules.d/51-android.rules
sudo service udev restart
sudo killall adb

Disconnect the USB cable between the phone and the computer.

Reconnect the phone.

Run adb devices to confirm that now it has permission to access the phone.

Please note that it's possible to use , USER="$LOGINNAME" instead of , MODE="0666" in the .rules file, substituting $LOGINNAME for your login name, i.e. what id -nu prints.

In some cases it can be necessary to give the udev rules file a name that sorts close to the end, such as z51-android.rules.

Milestone answered 30/9, 2012 at 18:55 Comment(13)
Note: for Ubuntu Precise the filename is 70-android.rules as per this post: esausilva.com/2010/05/13/…. Also kudos for letting us know you have to restart udev and kill all adb processes. Worked like a charm!Clap
A similar approach is officially documented at developer.android.com/tools/device.htmlBrokaw
Hi! Here a short script shell (tested on Linux Mint) that make the job previously described: Script shell to adb resetSaffren
This worked thanks, it has every type of device, maybe people fails in putting the rigth idVendor, for that you can put lsusb to see what the numbers is, but this almost exausthive list work great for most peopleHannover
This worked well but, as noted by @luciana in another answer, you might need to call sudo udevadm control --reload-rules to refresh udev rules if restarting the server isn't enough.Masked
You will need to add: , GROUP="plugdev" device detected successfully under ubuntu 14.04Intercept
You can use ATTR instead of ATTRS.Amice
For Alcatel add: SUBSYSTEM=="usb", ATTRS{idVendor}=="1bbb", MODE="0666"Catalonia
Your list says ATTRS{idVendor} but developer.android.com/tools/device.html says ATTR{idVendor} (without the 'S'). Which one is correct? (I haven't gotten either to work).Alberik
This should be marked as the correct answer, as sudo-ing adb shouldn't be a requirement for LinuxVainglorious
This is the only correct answer here. Thanks for it! Also, we can see lsusb output to make sure required vendor it is included. Most weird, only one of my devices (OnePlus One) suddenly stopped working after upgrading to Android 7.1.2 (even when run adb as root), after adding udev rules as described above, it works again.Rime
You need to create the file and copy it to the said location.Milestone
instead of maintaining the list - just use a single line rule for every Android phone - https://mcmap.net/q/99768/-set-up-device-for-development-no-permissionsAccouplement
M
88

Enter the following commands:

# cd to adb for sudo
cd `which adb | sed -e "s/adb//"`
adb kill-server
sudo ./adb start-server
./adb devices

This happens when you are not running adb server as root.  
Melissiamelita answered 13/8, 2012 at 15:8 Comment(5)
though the idea is the same as in the accepted answer, this one only helped me, due to the provided example. ThanksBrownie
@user907860 it's actually better than the accepted answer because it explains why you should write sudo :) (which I didn't do when I saw the accepted answer)Pivotal
btw any idea why adb should be running as root?Pivotal
sorry no, i dont rememberMelissiamelita
adb should NOT be running as root. If this is required, your system is misconfigured. Stop throwing "sudo" in front of everything, it has huge security implications.Berghoff
G
60

Tried all above, none worked .. finally worked when I switch connected as from MTP to Camera(PTP).

Gide answered 1/4, 2015 at 5:32 Comment(3)
For those wondering how to do this... System settings > Storage > Upper right button: USB computer connection > Connect As Select Camera (PTP) instead of Media device (MTP)Pyongyang
man, I was looking for the solution like two hours, this works to me on ubuntu 16.04, thanksRole
this should be the first thing to check. Works for meBroek
A
35

There are a lot of bad answers posted to this question ranging from insisting on running adb as root (which should not be touted as the only or even recommended solution) to solving completely unrelated issues.

Here is the single shortest and most universal recipe for taking care of permissions for all adb and fastboot devices at once:

echo 'ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:ff420?:*", MODE="0666"' | sudo tee /etc/udev/rules.d/99-android.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --verbose --action=add --subsystem-match=usb

Or you could use slightly longer version I posted to this gist.

As for the specific thing that OP did wrong in his question - it was not reloading the udev rules after editing the .rules file.

Also OP did not tell which Android build (aka ROM) he had on his phone. The idVendor value is set in software and therefore it depends on the ROM. So the value of 04E8 he used in his original rule would have worked only for devices with Samsung stock ROMs. But this is not a problem for this udev rule - it matches all devices with adb or fastboot interfaces regardless of their VendorID.

Accouplement answered 10/7, 2017 at 7:36 Comment(5)
Only missing step to see it working is adb kill-server before adb devices.Milliken
This doesn't seem to work anymore on Android 8.1. How did you find out what adb reports as device id?Orethaorferd
Worked for me on Android 7.1.2Kendry
@Cachapa, it works with all Android versions. Even the latest (at the time of me writing this) Android P Preview 4 uses the same adb interface IDs - android.googlesource.com/platform/system/core/+/…Accouplement
still works with Android 11 android.googlesource.com/platform/system/core/+/…Accouplement
L
17

In Archlinux this can happen occasionally. The fix:

$ sudo -s
# adb kill-server
# adb start-server
Levigate answered 24/9, 2014 at 3:23 Comment(2)
I'm not sure if that was the only thing that make it work... I tried the above stuff. But w/o this post ubuntu on VBox didn't make my LG G3 authorized. Thank you KeenanPronounced
I don't know why but sudo adb kill-server; sudo adb start-server didn't work but this one did.Ashlieashlin
W
9

For those using debian, the guide for setting up a device under Ubuntu to create the file "/etc/udev/rules.d/51-android.rules" does not work. I followed instructions from here. Putting down the same here for reference.

Edit this file as superuser

sudo nano /lib/udev/rules.d/91-permissions.rules

Find the text similar to this

# usbfs-like devices 
SUBSYSTEM==”usb”, ENV{DEVTYPE}==”usb_device”, \ MODE=”0664″

Then change the mode to 0666 like below

# usbfs-like devices 
SUBSYSTEM==”usb”, ENV{DEVTYPE}==”usb_device”, \ MODE=”0666″

This allows adb to work, however we still need to set up the device so it can be recognized. We need to create this file as superuser,

sudo nano /lib/udev/rules.d/99-android.rules

and enter

SUBSYSTEM==”usb”, ENV{DEVTYPE}==”usb_device”, ATTRS{idVendor}==”0bb4″, MODE=”0666″

the above line is for HTC, follow @grebulon's post for complete list.

Save the file and then restart udev as super user

sudo /etc/init.d/udev restart

Connect the phone via USB and it should be detected when you compile and run a project.

Wallacewallach answered 19/8, 2013 at 6:40 Comment(0)
E
5

I had the same problem, the solution is as fellow: (by the way, you don't have to root your device.)

  1. Type "su" to switch to super user.
  2. your-path/adb kill-server.
  3. your-path/adb start-server.
  4. If no error occurs, you can see the device list with "your-path/adb devices" in root account.
  5. Quit super user.
  6. Now you can perform "adb devices" in your account.

Enjoy.

Electroencephalograph answered 12/2, 2013 at 5:4 Comment(1)
In case you can't manage to login using su, use sudo su. I did. And also, if you don't know how to quit the user - use exit.Extraterritoriality
S
4

I had the same problem with my Galaxy S3. My problem was that the idVendor value 04E8 was not the right one. To find the right one connect your smartphone to the computer and run lsusb in the terminal. It will list your smartphone like this:

Bus 002 Device 010: ID 18d1:d002 Google Inc.

So the right idVendor value is 18d1. And the line in the /etc/udev/rules.d/51-android.rules has to be:

SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev" 

Then I run sudo udevadm control --reload-rules and everything worked!

Splasher answered 17/7, 2014 at 9:57 Comment(1)
Did you maybe mean: ATTR{idVendor}=="18d1"Worms
B
4

I know this might be a little late but here is a very good article on how to manually add Android ADB USB Driver. Manually adding Android ADB USB driver in Ubuntu 14.04 LTS

Edited to Add Link Content

Steps

Note: Make sure that you have connected your Android device in USB Debugging mode

Open terminal (CTRL + ALT + T) and enter command: lsusb

Now you might get a similar reply to this:
Bus 002 Device 013: ID 283b:1024

Note: With reference to this Bus 002 Device 008: ID 283b:1024
{idVendor}==”283b” {idProduct}==”1024″

Now enter the following command: sudo gedit /etc/udev/rules.d/51-android.rules
This creates the android rules file (51-android.rules) or open the existing one in the specified location (/etc/udev/rules.d)

Add a new line to this file:
SUBSYSTEM==”usb”, ATTRS{idVendor}==”283b”, ATTRS{idProduct}==”1024″, MODE=”0666″

Note Edit idVendor & idProduct values with your device values. Save and close.

Now enter the following command:
sudo chmod a+rx /etc/udev/rules.d/51-android.rules - grant read/execution permission
sudo service udev restart - Restart the udev service

Now we have to add the idVendor to adb_usb.ini. Enter the following commands:
cd ~/.android
gedit adb_usb.ini

Add the following value 0x283b

This is nothing but 0x(idVendor value). So replace the value with. respect to your device value Save and close the file.

Now enter the following command:
sudo service udev restart

Plug out the Android device and reconnect it again.
Now enter the following command:
adb kill-server
adb devices

There you go! Your device must be listed.

Copied From Manually adding Android ADB USB driver in Ubuntu 14.04 LTS

Worked for me.

Breathy answered 2/5, 2015 at 13:24 Comment(0)
C
3

Use the M0Rf30/android-udev-rules GitHub community maintained udev-rules

https://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, and it solved that problem for me.

Collative answered 21/10, 2017 at 21:24 Comment(3)
why bother with "maintaining the list" when a single rule works for all? https://mcmap.net/q/99768/-set-up-device-for-development-no-permissionsAccouplement
@AlexP. thanks I did not know about that method. Any idea why the official guide does not recomment that instead?Collative
Because of laziness and knowledge inertia mostly. The original Android developers used devices with the same vendor ID so they took the easiest approach they could think of. When more vendors created more devices - the developers just kept adding more IDs to the rules file.Accouplement
A
2
  1. Follow the instructions at http://developer.android.com/guide/developing/device.html(Archived link)
  2. Replace the vendor id of 0bb4 with 18d1 in /etc/udev/rules.d/51-android.rules

    Or add another line that reads:

    SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"
    
  3. Restart computer or just restart udev service.
Arst answered 26/7, 2013 at 10:8 Comment(0)
M
1

When you restart udev, kill adb server & start adb server goto android sdk installation path & do all on sudo. then run adb devices it will solve permission problem.

Mucronate answered 16/3, 2012 at 14:37 Comment(0)
F
1

My device is POSITIVO and my operational system is Ubuntu 14.04 LTS So, my problem was in variable name

I create the file /etc/udev/rules.d/51-android.rules and put SUBSYSTEM=="usb", SYSFS{idVendor}=="1662", MODE="0666"

I disconnected device and execute:

$ sudo udevadm control --reload-rules
$ sudo service udev restart

after this i connected the android device in developer mode again and

$ adb devices

List of devices attached 
1A883XB1K   device
Foundation answered 24/8, 2014 at 4:36 Comment(0)
A
1

Without unplugging

All the provided answers assume that you are able to unplug and reconnect the USB cable. In situations where this is not possible (e.g., when you are remote), you can do the following to essentially do what the suggested udev rules would do on re-plug:

lsusb

Find the device you care about, e.g.:

Bus 003 Device 005: ID 18d1:4ee4 Google Inc. Nexus

Take note of the bus number it is on and then execute, e.g. for bus 003:

sudo chmod a+w /dev/bus/usb/003/*

Clearly this may be more permissive than you want (there may be more devices attached than just this one), but you get the idea.

Arkhangelsk answered 29/7, 2016 at 16:28 Comment(1)
to apply the new udev rule without reconnecting the device just use udevadm trigger --verbose --action=add --subsystem-match=usb command.Accouplement
S
1

You should NOT run adb server as root as other answers are suggesting. Instead if you are using Arch Linux do the following:

  1. Install the android-udev package with Pacman
  2. Reload udev rules:

    # udevadm control --reload-rules
    
  3. Add yourself to adbusers group and then logout and login:

    # usermod -aG adbusers $LOGNAME
    

Source: https://wiki.archlinux.org/index.php/android#Configuring_adb

Stapes answered 29/3, 2018 at 6:43 Comment(0)
B
1

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.

Buncombe answered 3/5, 2018 at 8:25 Comment(0)
B
1

Only for Ubuntu/ Debian users: There are some specific things to do for ubuntu to make USB debugging work: described here: https://developer.android.com/studio/run/device Here are the two steps mentioned. Run this two command in terminal:

sudo usermod -aG plugdev $LOGNAME
sudo apt-get install android-sdk-platform-tools-common
Bid answered 19/9, 2020 at 15:23 Comment(0)
B
0

Try instead of GROUP="plugdev" use the main group of your user.

Blondellblondelle answered 9/2, 2012 at 11:53 Comment(1)
I am using my username, it does not helpLocally
S
0

In my case on ubuntu 12.04 LTS, I had to change my HTC Incredible usb mode from charge to Media and then the device showed up under adb. Of course, debugging was already on in both cases.

Spore answered 25/9, 2013 at 15:4 Comment(0)
S
0

I had the same problem and I followed these steps:

# Clone this repository
git clone https://github.com/M0Rf30/android-udev-rules.git
cd android-udev-rules
# Copy rules file
sudo cp -v 51-android.rules /etc/udev/rules.d/51-android.rules
# OR create a sym-link to the rules file - choose this option if you'd like to update your udev rules using git.
sudo ln -sf "$PWD"/51-android.rules /etc/udev/rules.d/51-android.rules
# Change file permissions
sudo chmod a+r /etc/udev/rules.d/51-android.rules
# If adbusers group already exists remove old adbusers group
groupdel adbusers
# add the adbusers group if it's doesn't already exist
sudo mkdir -p /usr/lib/sysusers.d/ && sudo cp android-udev.conf /usr/lib/sysusers.d/
sudo systemd-sysusers # (1)
# OR on Fedora:
groupadd adbusers
# Add your user to the adbusers group
sudo usermod -a -G adbusers $(whoami)
# Restart UDEV
sudo udevadm control --reload-rules
sudo service udev restart
# OR on Fedora:
sudo systemctl restart systemd-udevd.service
# Restart the ADB server
adb kill-server
# Replug your Android device and verify that USB debugging is enabled in developer options
adb devices
# You should now see your device

The above steps are described on android-udev-rules. It worked for me.

Just be sure to confirm the dialog that will appear on your phone screen after replug it.

Selig answered 9/3, 2020 at 16:36 Comment(0)
T
0
sudo usermod -aG plugdev $LOGNAME

This command worked for me

Tamelatameless answered 20/6, 2020 at 5:40 Comment(0)
S
0

When you connect usb to computer, it asks you if you trust the computer to debug apps on the phone. Clicking yes solved the problem

Seymour answered 24/3, 2021 at 16:24 Comment(0)
P
0

This was driving me bananas. First and foremost some of the really old suggestions here can brick your arch linux system. I had to boot from a rescue USB to undo the rules hacks. In my facepalm of a case, i couldn't get my android to prompt for authorizing the host when plugged into USB and had the same symptom as everyone else:

$ sudo adb devices
List of devices attached
89MY08NPA       no permissions; see [http://developer.android.com/tools/device.html]

being root didn't matter.

Go into your android's USB settings and make sure Use USB for is set to File Transfer. Mine was set to no data transfer for some reason even though I've been doing android dev on this phone for years. Some update from Google must have flipped it to another setting.

Once you set it to file transfer you get promted to allow debugging from the host and back to normal

enter image description here

Parterre answered 10/1, 2022 at 15:35 Comment(0)
L
0

I had tryed some of the aforementioned solutions:

  • restart adb server
  • amend 51-android.rules
  • add myself to adbusers group

and it worked once. The device asked me to authorize the PC and afterwards, everything was working OK.

The issue was when I tried to connect the device after the PC reboot, that Again the issue was the same. In order to vercome now this issue I had to manually revoke Settings->Developer Options->USB debugging authorizations and then the device asked me again to authorize the PC, and thus finally worked.

One other time the aforementioned solution with revoking USB debugging authorization didn't wokred, and in order to trigger authentication of the device I had to manually disable/enable the Settings->Developer options->USB debugging

I am using ubuntu 20.04LTS.

Lobscouse answered 17/3, 2022 at 9:30 Comment(0)
R
0

If you are on debian like Ubuntu, deepin etc based distro you can try to run

sudo apt-get install android-sdk-platform-tools-common

Voila your problem solved

Radish answered 6/5, 2022 at 7:10 Comment(0)
B
0

If all other solutions don't work for you, simply unplug your phone, turn off Use developer options, turn on again then plug your phone.

Bunk answered 17/3, 2023 at 3:10 Comment(0)
A
-1

I used su and it started working. When I use Jetbrains with regular user, I see this problem but after restarting Jetbrains in su mode, I can see my device without doing anything.

I am using Ubuntu 13.04 and Jetbrains 12.1.4

Agricola answered 23/11, 2013 at 4:3 Comment(0)
H
-1

You could also try editing adb_usb.ini file, located at /home/username/.android/. This file contains id vendor list of devices you want to connect. You just add your device's id vendor in new line (it's one id per line). Then restart adb server and replug your device.

It worked for me on Ubuntu 12.10.

Haematocryal answered 20/9, 2014 at 7:40 Comment(0)
P
-1

Anyway, what I did to solve this problem(on Ubuntu).

  1. Defined in what cases I need to run these commands. For most ubuntu users there is a home folder (hidden file .bashrc).

    In which you can record the launch of these commands. But these commands will be triggered when you enter the bash command in the console.

  2. Since I have a shell .zshrc then I did the following:

    open console: gedit .zshrc

When the file opens, add the following line:

./.add_device_permissions.sh

After or before, we need to create this file: .add_device_permissions.sh in which we write the following:

#!/bin/bash
# Add permissions
ADB="/home/vadimm/Android/Sdk/platform-tools/adb"
$ADB devices
$ADB kill-server
cat .permissions_redmi_note | sudo -S $ADB devices
$ADB kill-server
cat .permissions_redmi_note | sudo -S $ADB devices

Also we need create .permissions_redmi_note where we need to hardcode our password.

  1. Not to add to the file .zshrc unnecessary we can specify the path when starting the system itself: Startup Applications Preferences

Where we press on "Add" and write our command: /home/vadimm/.add_device_permissions.sh

  1. Also u can tried use in command line next commands: ./adb devices ./adb kill-server sudo ./adb devices ./adb kill-server ./adb devices
Publias answered 8/11, 2018 at 12:15 Comment(0)
O
-2

If anyone faces the following error message when they use adb devices

no permissions (verify udev rules); see [http://developer.android.com/tools/device.html]

Execute the following

sudo -s 
adb kill-server
adb start-server

That fixed the issue for me on a custom build android device

Odle answered 28/8, 2017 at 16:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.