Android device is not recognized in adb

痞子三分冷 提交于 2019-12-06 09:10:58

When this happens to me, I have to restart adb as follows:

$ adb kill-server $ sudo /path_to_android_sdks/android-sdks/platform-tools/adb devices

I have this as a short script which I execute whenever I get the "?????" device showing up. Works every time for me.

There might be a problem with your USB device vender id.

Try different device ids as available in Android documentation (http://developer.android.com/tools/device.html). Many devices are recognized using Google (18d1). All other things are simple. Just Create a file:

sudo gedit /etc/udev/rules.d/51-android.rules

and add:

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

then run:

sudo chmod a+r /etc/udev/rules.d/51-android.rules

Then plug your device into PC with USB debugging OFF, after connecting, turn USB debugging ON and goto:

cd <sdk_path>/platform-tools

and run:

./adb devices

You'll see a device with some code excluding emulator (if running). That's it! Now you can test your apps in your real device. While running, SDK will offer you to choose device if simulator is also running.

Ghazi's response was useful but I had to do it in a different way on my Ubuntu 12.04. I had to change GROUP to OWNER="your username on ubuntu" and then it worked.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!