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:
in my project
AndroidManifest.xml
file, addedandroid:debuggable="true"
to the<application>
elementOn the device, in the Settings > Security enabled Unknown sources
On the device, in the Settings > Developer options enabled USB debugging
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"
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?
Anyway, what I did to solve this problem(on Ubuntu).
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.Since I have a shell .zshrc then I did the following:
open console:
gedit .zshrc
When the file opens, add the following line:
After or before, we need to create this file:
.add_device_permissions.sh
in which we write the following:Also we need create .permissions_redmi_note where we need to hardcode our password.
.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
./adb devices ./adb kill-server sudo ./adb devices ./adb kill-server ./adb devices
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):
Run the following commands:
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. whatid -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
.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.
You should NOT run
adb
server as root as other answers are suggesting. Instead if you are using Arch Linux do the following:android-udev
package with PacmanReload udev rules:
Add yourself to
adbusers
group and then logout and login:Source: https://wiki.archlinux.org/index.php/android#Configuring_adb
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 permissionsudo service udev restart
- Restart theudev
serviceNow we have to add the
idVendor
toadb_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.
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
Find the text similar to this
Then change the mode to 0666 like below
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,
and enter
the above line is for HTC, follow @grebulon's post for complete list.
Save the file and then restart udev as super user
Connect the phone via USB and it should be detected when you compile and run a project.