为什么 Eclipse 的 Android 设备选择器没有显示我的 Android 设备?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3429959/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Why is Eclipse's Android Device Chooser not showing my Android device?
提问by Subrat
I am using the Android plugin for Eclipse, and when I try to run my program using a real device through the Android Device Chooser, my phone is not listed as a device. I have updated Eclipse, all of the Android packages, and the USB driver, but it still isn't showing up. My phone is running Android 2.1, which is also the target version listed in the Eclipse project.
我正在使用 Eclipse 的 Android 插件,当我尝试通过Android 设备选择器使用真实设备运行我的程序时,我的手机未列为设备。我已经更新了 Eclipse、所有的 Android 包和 USB 驱动程序,但它仍然没有显示出来。我的手机运行的是Android 2.1,也是Eclipse项目中列出的目标版本。
Also it happens that the device shows up as an unknown target and the serial number as question marks as shown in the screenshot.
此外,设备显示为未知目标,序列号显示为问号,如屏幕截图所示。
回答by vsm
Did you try from your command line (assumed linux)
您是否从命令行尝试过(假设为 linux)
adb devices
If you got a lot of question marks
如果你有很多问号
List of devices attached
?????????????? device
Check what is the vendor ID of your device:
检查您的设备的供应商 ID 是什么:
lsusb
> Bus 003 Device 006: ID 04e8:689e Samsung Electronics Co., Ltd
Vendor ID is '04e8' in this case.
在这种情况下,供应商 ID 是“04e8”。
You need to add your device to USB list
您需要将您的设备添加到 USB 列表
sudo vim /etc/udev/rules.d/51-android.rules
and put this line (use your own vendor ID).
并放置此行(使用您自己的供应商 ID)。
SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666"
Alternatively try the following syntax as pointed out by mcordaro and Yekmer Simsek referring to the documentation
或者,尝试使用 mcordaro 和 Yekmer Simsek 指出的以下语法,参考文档
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev"
save it, and then
保存,然后
sudo chmod a+r /etc/udev/rules.d/51-android.rules
sudo service udev reload
and it should work now.
它现在应该可以工作了。
回答by Joe
I just had the same issue with the Motorola Droid. I had 3 devices and only 1 was detected in the ADB. The one that worked showed up in device manager as "android adb composite interface" and the 2 that did not work showed up as "android adb interface". In Windows 7 I did the following.
我刚刚在摩托罗拉 Droid 上遇到了同样的问题。我有 3 台设备,但在 ADB 中仅检测到 1 台。有效的一个在设备管理器中显示为“android adb 复合界面”,而无效的 2 个显示为“android adb 界面”。在 Windows 7 中,我执行了以下操作。
- Right Click Computer then Manage
- Expand Android phone at the top of the list
- Right click Android ADB Interface then Update Driver Software
- Browse my computer for driver software
- Let me pick from a list of device drivers on my computer
- Choose USB Composite Device then next
- 右键单击计算机然后管理
- 展开列表顶部的 Android 手机
- 右键单击 Android ADB 接口,然后更新驱动程序软件
- 浏览我的计算机以查找驱动程序软件
- 让我从计算机上的设备驱动程序列表中选择
- 选择 USB Composite Device 然后下一步
If USB Composite Device doesn't show up then try browsing to the usb_driver folder in your android sdk directory for step 5 then try step 5 and 6 again.
如果 USB Composite Device 没有出现,请尝试浏览您的 android sdk 目录中的 usb_driver 文件夹以进行第 5 步,然后再次尝试第 5 步和第 6 步。
Note : If Android does not appear at the top of this list as described in #2 and/or you find a device ADB with no drivers then you probably need to install the device driver, which in my case (HTC Glacier) was located right on my phone.
注意:如果 Android 没有出现在此列表的顶部,如#2 中所述和/或您找到一个没有驱动程序的设备 ADB,那么您可能需要安装设备驱动程序,在我的情况下(HTC Glacier)位于正确的位置在我的手机上。
回答by Matthew Cordaro
This linkto the Android Developers'website holds the key to solving this problem on all supported platforms. Follow the steps for Setting up a Device for Development.
此Android 开发人员网站链接是在所有支持的平台上解决此问题的关键。按照设置用于开发的设备的步骤操作。
Note: Since this page is run by the Android Development Team, it should be updated with any changes in procedures as new adbversions are released.
注意:由于此页面由 Android 开发团队运行,因此在发布新的adb版本时,应根据过程中的任何更改对其进行更新。
回答by Marecky
There is one thing some could not remember. Like myself, if you tried to run adb with superuser credentials following a run with regular user credentials, don't expect success. First, you have to kill adb which was run with lousy rights and start it again with sudo:
有一件事有些人不记得了。像我一样,如果您在使用常规用户凭据运行后尝试使用超级用户凭据运行 adb,请不要指望成功。首先,您必须终止以糟糕权限运行的 adb,然后使用 sudo 重新启动它:
marek@deb42:~$ sudo adb kill-server
marek@deb42:~$ sudo adb kill-server
marek@deb42:~$ sudo adb devices
marek@deb42:~$ sudo adb devices
回答by Yevgeny Simkin
I figured it out, though it sounds like we have different problems. However, just in case this helps you.
我想通了,虽然听起来我们有不同的问题。但是,以防万一这对您有所帮助。
First of all your manifest has to have the android:debuggable="true" attribute in the Application node. You probably have this, and I don't know if it actually contributes to the device showing up or not.
首先,您的清单必须在 Application 节点中具有 android:debuggable="true" 属性。你可能有这个,我不知道它是否真的有助于设备出现。
In any event, the thing I was doing wrong was when I run or debug my configuration (in Eclipse) under the target tab (where it lists your emulator device setups) I had the Automatic radio button checked. If you flip that to manual it then gives you another dialog when you hit Run, and in THAT dialog, on the top, I see my device.
无论如何,我做错的事情是当我在目标选项卡(它列出您的模拟器设备设置)下运行或调试我的配置(在 Eclipse 中)时,我选中了自动单选按钮。如果您将其翻转为手动,那么当您点击“运行”时,它会为您提供另一个对话框,并且在该对话框的顶部,我会看到我的设备。
Lastly, (and I only see this on the Droid X) when you are in PC mode the device doesn't act as though it's connected to the machine. When you're in Mass Storage mode, everything works as expected BUT then the SD card is disabled, so, if your app happens to WRITE to the SD card it will fail at that point in execution. The Captivate (my other test device) does not suffer from the same problem.
最后,(我只在 Droid X 上看到这个)当您处于 PC 模式时,设备不会像连接到机器一样工作。当您处于大容量存储模式时,一切都按预期工作,但是 SD 卡被禁用,因此,如果您的应用程序碰巧写入 SD 卡,它将在执行时失败。Captivate(我的其他测试设备)没有遇到同样的问题。
回答by Prostokvashkin
Check that your device connected as PTP device(Camera). Notification Bar -> USB Connection. If your device connected as MTP(as common data storage) then AndroidStudio don't recognize it as debuggable device. At least that works for me and my Nexus.
检查您的设备是否连接为 PTP 设备(相机)。通知栏 -> USB 连接。如果您的设备作为 MTP(作为公共数据存储)连接,那么 AndroidStudio 不会将其识别为可调试设备。至少这对我和我的 Nexus 有用。
回答by someuser
I had the same problem and after trying many of the solutions posted above finally tried changing the cable and it worked instantly.
我遇到了同样的问题,在尝试了上面发布的许多解决方案后,终于尝试更换电缆,并且立即生效。
回答by Rupesh Yadav
回答by Randika Vishman
Hope this solution will fix your mood this time!
希望这个解决方案能解决你这次的心情!
Issue:My Android Device isn't recognized by the Eclipse ADT, why?
问题:Eclipse ADT 无法识别我的 Android 设备,为什么?
Cause:Device Driver was missing as it seemed at the end when I fixed it!
原因:设备驱动程序丢失,就像我修复它的最后一样!
How to Fix:
怎么修:
- Search through web (using Google) "LG < Your_Phone_Model Number > Drivers Download".(Ex.:- Go to About phone in your settings list >Model Number, for me it's LG-E400f)
- Mostly the first few links are related to the required Device Driver download page.(Ex.:- for me I got the following linkand for each device driver LG or most of the other vendors/manufactures have that kind of a Manuals and Drivers Page) Visit that page mentiioning about software update and drivers downloads.
- Scroll down to the section of "Manuals and Software Update" and doing just the Step 1was enough for me, which is "Install the USB DRIVERS"
- Download it(for Mac or Windows) >Install It >Check Your Eclipse ADT >and it should be visible under Devices tab by now
- 通过网络搜索(使用 Google)“ LG < Your_Phone_Model Number > Drivers Download”。(例如:-转到设置列表中的关于手机>型号,对我来说是 LG-E400f)
- 大多数前几个链接与所需的设备驱动程序下载页面相关。(例如:-对我来说,我得到了以下链接,对于每个设备驱动程序 LG 或大多数其他供应商/制造商都有那种手册和驱动程序页面) 访问该页面,其中提到了软件更新和驱动程序下载。
- 向下滚动到“手册和软件更新”部分,只执行步骤 1对我来说就足够了,即“安装USB 驱动程序”
- 下载它(对于 Mac 或 Windows)>安装它>检查你的 Eclipse ADT >现在它应该在设备选项卡下可见
Cheers!!!
Hope this helps to someone else to clearly get to the solution!
干杯!!!
希望这有助于其他人清楚地找到解决方案!
回答by jwatts1980
Another thing you can try is looking for the USB drivers from the manufacturers website. Windows Update does not always include these drivers. My Acer Iconia a700 tablet would not show up in Eclipse until I downloaded and installed the drivers from Acer's website.
您可以尝试的另一件事是从制造商网站上查找 USB 驱动程序。Windows Update 并不总是包含这些驱动程序。在我从 Acer 的网站下载并安装驱动程序之前,我的 Acer Iconia a700 平板电脑不会出现在 Eclipse 中。