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 msg
–
Andro SelvaFeb 9 '12 at 11:44

could you paste the exact command you use? I use sudo /opt/android/platform-tools/adb devices
–
WarrenFaithFeb 9 '12 at 12:20

I use the same syntax command. "sudo /PATH_TO_ANDROID_SDK/platform-tolls/adb devices" It does not help
–
Leem.finFeb 9 '12 at 12:26

2

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...
–
WarrenFaithFeb 10 '12 at 9:45

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!
–
Eduard LucaJan 4 '13 at 10:01

1

This worked for me, while running adb as root didn't.
–
myanimalJan 21 '13 at 8:58

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.

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 you smartphone to the computer and write in terminal the command

lsusb

as result i found all conected usb devices with the right id. There must be an line where your smartphone is displayed like:

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

in my case. So the right idVendor Value is "18d1". So the line in the /etc/udev/rules.d/51-android.rules has to be in my case

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.

As mentioned above the issue is caused by not running adb with root permissions.

I wanted to add my solution to the problem running Ubuntu 12.04 with Android Studio 0.8.2. Which also will show you how to open android studio without typing the full path:

First you add android-studio/bin to your PATH by editing your .bashrc file.

cd ~/
gedit .bashrc
//add the below line withing your .bashrc file, I prefer you to put it at the
//very bottom
HOME=$HOME:~/<android-studio>/bin
//save file, exit terminal, open new terminal
studio.sh // will now open android studio from any directory in terminal

This will allow you to run the program with the studio.sh command from within the terminal from any directory.But this will not allow you to run it with sudo from within the terminal from any directory!!! Which brings us back to our main issue.To do this we will need to edit our /etc/sudoers file.

cd /etc
sudo gedit sudoers
//edit the secure_path="" to include /home/<your-username>/<android-studio>/bin
//save file, exit terminal, open new terminal
gksudo studio.sh // will now open android studio as root from any direcotry in terminal
// I use gksudo rather than sudo when opening a graphical program

Now adb is run as root and your computer will recognize your connected device. And you can start the program from any directory. This is just the way I fixed the problem and thought I'd share.

As Debian goes, I did the above things having been using Kali. After chown command and a reboot I lost use of my laptop and external keyboard / mouse. Dual booting Ubuntu Studio, I booted to that, mounted Debian partition, opened a terminal and

sudo su
rm path/to/all.android.rules

Both in /libs/udev ... AND /etc/udev AND

gedit /lib/udev/rules.d/91-permissions.rules

And switched back that to

usbfs-like devices

SUBSYSTEM==”usb”, ENV{DEVTYPE}==”usb_device”, \ MODE=”0666″

Reboot and all keyboards/ mice work again. Also, reboot back to Kali / Debian with no android.rules and "normal" 91-permission.rules and...

adb devices

Works as it should - with permissions etc. I do still have my non root user in plugdev group. Have adb path in $PATH. Have adb at /home/user/andy/sdk/platform-tools/