Android Nexus 5 不会在 Eclipse 中显示

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21392226/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 04:28:43  来源:igfitidea点击:

Nexus 5 will not show in Eclipse

androideclipsenexus-5

提问by user3164083

My new Nexus 5 will not show in Eclipse. I have tried every single solution on the internet for the last 3 hours. I have windows 8, not 8.1. I have a new HP Envy laptop. I am under a tight time-frame and need to get developing with this phone.

我的新 Nexus 5 不会在 Eclipse 中显示。在过去的 3 个小时里,我已经尝试了互联网上的每一个解决方案。我有 Windows 8,而不是 8.1。我有一台新的 HP Envy 笔记本电脑。我的时间很紧,需要使用这款手机进行开发。

Allow usb debugging is checked. The drivers are up to date and downloaded from the Android developer site for Nexus 5. I have then gone into device manager and right-clicked -> update drivers -> browse -> gone to that usb-driver file in Android sdk, made sure include sub-directories is checked, then click finish. It installs. They are already up to date. Tried selecting choose from list. then selcting MTP USB device and installing. That's the only one that shows up as compatible for me.

允许 USB 调试被选中。驱动程序是最新的,并从 Nexus 5 的 Android 开发人员站点下载。然后我进入设备管理器并右键单击 -> 更新驱动程序 -> 浏览 -> 转到 Android sdk 中的 USB 驱动程序文件,确保包括子目录被选中,然后单击完成。它安装。他们已经是最新的了。尝试从列表中选择。然后选择MTP USB设备并安装。这是唯一一个对我来说兼容的。

I have switched from MTP USB connection to PTP USB connection.

我已从 MTP USB 连接切换到 PTP USB 连接。

I have reset the adb in the DDMS.

我已经在 DDMS 中重置了 adb。

I have found my hardwareId in Device Manager and then added the correct lines of code into the android_winusb.inf file.

我在设备管理器中找到了我的硬件 ID,然后将正确的代码行添加到 android_winusb.inf 文件中。

I have gone into Android SDK manager, and under extras installed "Google USB driver". Mine is rev 8. Is that okay?

我已经进入 Android SDK 管理器,并在额外安装了“Google USB 驱动程序”。我的是 rev 8。可以吗?

After all that I have restarted my computer and the phone.

毕竟我已经重新启动了我的电脑和手机。

My phone has always been recognised by my computer without doing anything. It is just Eclipse that needs to recognise it.

我的手机一直被我的电脑识别,没有做任何事情。只有 Eclipse 需要识别它。

UPDATE:Originally I was finding my Nexus 5 in the device manager under portable devices and when i updated drivers from here it had no effect. Just then it popped up under "Other" and i updated the drivers with some i found recommended online but it said at the end "Samsung drivers installed" and this is LG. Then now I see my Nexus popping up under "Android device" in the device manager. EDITActually it says Android composite ADB interface. My Nexus is not under "Other" anymore. It is only under portable devices. Now my phone is showing up in Eclipse. But it is status offline, and When i click to run my app, it is there, but i cannot press "OK", and the target is unknown with a warning. Maybe the solution now is to double check i download correct drivers, ones that don't say "Samsung".

更新:最初我在便携式设备下的设备管理器中找到了我的 Nexus 5,当我从这里更新驱动程序时,它没有任何效果。就在这时它突然出现在“其他”下,我更新了一些我在网上推荐的驱动程序,但最后它说“安装了三星驱动程序”,这是LG。然后现在我看到我的 Nexus 在设备管理器的“Android 设备”下弹出。编辑实际上它说Android复合ADB接口。我的 Nexus 不再在“其他”之下。它仅在便携式设备下。现在我的手机出现在 Eclipse 中。但它处于离线状态,当我点击运行我的应用程序时,它就在那里,但我无法按“确定”,并且目标未知并带有警告。也许现在的解决方案是仔细检查我下载了正确的驱动程序,

Thanks.

谢谢。

回答by Aakash

Try these steps and see if the device is recognized.

尝试这些步骤,看看设备是否被识别。

First check if you have Developer Options in the Settings Menu of your device.

首先检查您设备的设置菜单中是否有开发者选项。

If not - (Please know that in flagship nexus devices running 4.2 and later Android OS this option is hidden by Google on purpose)

如果不是 - (请注意,在运行 4.2 及更高版本 Android 操作系统的旗舰 nexus 设备中,此选项被 Google 故意隐藏)

How to Enable developer options - Go to Settings --> About Phone --> Build Number (Tap the build number 7 times) this should enable your Developer Option

如何启用开发人员选项 - 转到设置 --> 关于手机 --> 内部版本号(点击内部版本号 7 次)这应该会启用您的开发人员选项

Turn on USB Debugging

开启USB调试

Connect your Nexus 5 to your computer using the USB cable.

使用 USB 数据线将 Nexus 5 连接到计算机。

If at this point Eclipse do not recognize it. Try to start a command prompt on Windows by pressing Ctrl + R and type cmd and enter.

如果此时 Eclipse 无法识别它。尝试通过按 Ctrl + R 并键入 cmd 并回车在 Windows 上启动命令提示符。

Navigate to where you have installed your Android SDK folder where you have your adb.exe.

导航到您的 Android SDK 文件夹的安装位置,其中包含您的 adb.exe。

For me this is at C:\Program Files (x86)\Android\android-sdk\platform-tools\

对我来说这是在 C:\Program Files (x86)\Android\android-sdk\platform-tools\

Do a cd C:\Program Files (x86)\Android\android-sdk\platform-tools- enter

做一个cd C:\Program Files (x86)\Android\android-sdk\platform-tools- 输入

then type adb deviceswhile your nexus 5 is attached to your computer. this should restart the adb server killing any stale session. At this point you should receive instructions on your device about RSA fingerprint etc. Just accept it and Eclipse should be able to communicate with your device.

然后adb devices在您的 nexus 5 连接到您的计算机时键入。这应该重新启动 adb 服务器以杀死任何过时的会话。此时,您应该会在您的设备上收到有关 RSA 指纹等的说明。只要接受它,Eclipse 应该能够与您的设备进行通信。

Edit:

编辑:

You may need to install adb drivers after following aforementioned procedure. Download universal adb driver installer from hereand execute it. It would automatically detect your phone model and will install drivers.

按照上述步骤操作后,您可能需要安装 adb 驱动程序。从这里下载通用 adb 驱动程序安装程序并执行它。它会自动检测您的手机型号并安装驱动程序。

Happy Coding..

快乐编码..

回答by user1659482

For windows 8 64 bit

对于 Windows 8 64 位

Download USB driver from here http://developer.android.com/sdk/win-usb.html#top

Connect your Android-powered device to your computer's USB port.
Right-click on Computer from your desktop or Windows Explorer, and select Manage.
Select Devices in the left pane.
Locate and expand Other device in the right pane.
Right-click the device name (such as Nexus S) and select Update Driver Software. This will launch the Hardware Update Wizard.
Select Browse my computer for driver software and go to the usb driver folder which downloaded from above provided link.
(or)
if you installed usb driver from sdk manager. locate the USB driver folder. (The Google USB Driver is located in \extras\google\usb_driver.)
Click Next to install the driver.

从这里下载 USB 驱动程序http://developer.android.com/sdk/win-usb.html#top

将您的 Android 设备连接到您计算机的 USB 端口。
在桌面或 Windows 资源管理器中右键单击“计算机”,然后选择“管理”。
在左侧窗格中选择设备。
在右侧窗格中找到并展开其他设备。
右键单击设备名称(例如 Nexus S)并选择更新驱动程序软件。这将启动硬件更新向导。
选择浏览我的计算机以查找驱动程序软件,然后转到从上面提供的链接下载的 USB 驱动程序文件夹。
(或)
如果您从 sdk 管理器安装了 USB 驱动程序。找到 USB 驱动程序文件夹。(Google USB 驱动程序位于 \extras\google\usb_driver 中。)
单击下一步安装驱动程序。

Follow the above steps this worked for me for more information visit here http://developer.android.com/tools/extras/oem-usb.html#InstallingDriver

按照上述对我有用的步骤获取更多信息,请访问这里http://developer.android.com/tools/extras/oem-usb.html#InstallingDriver

回答by PM89

First, uninstall through the device manager and check the delete check box before reinstalling.

首先,通过设备管理器卸载并在重新安装之前选中删除复选框。

Then install from here: \sdk\extras\google\usb_driver

然后从这里安装:\sdk\extras\google\usb_driver

It will now work.

它现在将起作用。

Solution comes from this site: http://www.techotopia.com/index.php/Testing_Android_Applications_on_a_Physical_Android_Device_with_ADB

解决方案来自这个站点:http: //www.techotopia.com/index.php/Testing_Android_Applications_on_a_Physical_Android_Device_with_ADB