“Android device is not listed while running adb de

2020-03-07 02:56发布

问题:

My Android device Ly-706 is not listed while running adb devices.

I can run emulator using eclipse and install application on emulator using adb except on Real device

I added:

SUBSYSTEM=="usb", SYSFS{idVendor}=="040d", MODE="0666"

in /etc/udev/rules.d/90-android.rules ,still no luck

Same result for samsung galaxy 3(vendor id ="04e8")

I installed GNU/Linux (ubuntu 10.10) because it is not listing in windows.

What am I missing?

回答1:

I always run adb as root the first time, and as normal user thereafter. But I run a virtual machine that I suspend so I don't have to do it often.

ou have the right idea, the solution is most definately that you need the permission in the file within rules directory. The only suggestion I can make is that you are using the wrong vendor id.

Look it up here

Also, to make sure you're running the correct adb under root, run both of:

sudo adb kill-server
adb kill-server

before:

sudo adb start-server

I have found just running the one doesn't always work.



回答2:

As a temporary workaround you could try starting the adb daemon as root:

sudo adb kill-server sudo adb devices

This worked for me until I managed to get udev set up properly.



回答3:

sudo /etc/init.d/udev restart

as suggestend by trojanfoe is worth trying, but i guess, you did some restarts in between anyways.

Did you try to restart the adb server BEFORE you usb-plug your device? That helped me out.



回答4:

In my case it suddenly stopped detecting my device, but from time to time it detected it, which drived me crazy.

After many kills and restarts, it ended up being something wrong with the USB cable. Changing it solved the problem, tho I have no clue why this could happen.



回答5:

The rule SUBSYSTEM=="usb", SYSFS{idVendor}=="040d", MODE="0666" would actually give access to the device, but the problem might be that your user may not have the permission for accessing the device.

Because you are not giving the groups for the rule, I don't know which group will have the default access to the device (i'm guessing maybe the udev group will have it), and if you would have followed the google's path of device setup (see section 3, third point, subsection a), you will realize that you have missed out the GROUP clause in the rule.

So basically your rule should be.

UBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE=="0666", GROUP="plugindev"

also check if you are in the group plugindev using the command groups. else you can give there whatever as long as you are in the group



回答6:

Until Ubuntu 10 LTS the correct command is simply copying the adb which comes with the Google SDK, to /bin directory, insert the line according to your device in

/etc/udev/rules.d/70-persistent-net.rules:

#Acer
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666"
#Dell
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666"
#Foxconn
SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666"
#Garmin-Asus
SUBSYSTEM=="usb", ATTR{idVendor}=="091E", MODE="0666"
#Google
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666"
#HTC
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"
#Huawei
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666"
#Kyocera
SUBSYSTEM=="usb", ATTR{idVendor}=="0482", MODE="0666"
#LG
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"
#Motorola
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666"
#Nvidia
SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0666"
#Pantech
SUBSYSTEM=="usb", ATTR{idVendor}=="10A9", MODE="0666"
#Samsung
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666"
#Sharp
SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", MODE="0666"
#Sony Ericsson
SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666"
#ZTE
SUBSYSTEM=="usb", ATTR{idVendor}=="19D2", MODE="0666"

Then restart udev and adb

sudo service udev restart
adb kill-server ; adb kill-server

It seems to change in Ubuntu 11, also, there is probably a possibility to make Ubuntu read any file you specify .rules, I just don't know how yet.



回答7:

I was getting the same error until I edited sudoers. You can get path of your platform-tools and tools folder of android SDK and type :

sudo gedit /etc/sudoers
edit line `<<<<<      Defaults      secure_path=" >>>>>` 

add complete the path there and enjoy.