Android 通过 Windows 7 x64 中的“adb 设备”通过 USB 看不到 Nexus 7
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11974700/
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
Nexus 7 not visible over USB via "adb devices" from Windows 7 x64
提问by Mike Hanafey
I have done the obvious -- the USB driver was installed from the latest Android SDK, and USB debugging was turned on in the tablet.
我已经做了显而易见的事情——USB 驱动程序是从最新的 Android SDK 安装的,并且在平板电脑中打开了 USB 调试。
When the Nexus 7is connected, the device shows up in the Windows Device Manageras "Android Phone" / "Android Composite ADB Device", with the properties showing driver version 6.0.0.0, so the correct driver is installed and working.
当的Nexus 7连接,该设备显示了在Windows设备管理器为“Android手机” /“Android的综合亚设备”,以显示驱动程序版本6.0.0.0的属性,所以在安装正确的驱动程序和工作。
This also proves the device is in USB debugging mode, because if it is not it shows up in Windows under "Portable Devices" / "Nexus 7".
这也证明设备处于 USB 调试模式,因为如果不是,它会显示在 Windows 中的“便携式设备”/“Nexus 7”下。
The problem is that adb devices
shows no devices, and Eclipsealso (not surprisingly) also does not offer the Nexus 7 as a hardware device to run an app on.
问题是adb devices
没有显示任何设备,而且Eclipse也(不足为奇)也不提供 Nexus 7 作为运行应用程序的硬件设备。
I have rebooted both devices without effect.
我已经重新启动了两个设备都没有效果。
The only debugging I can figure out is enable ADB_TRACE=all
, but this tells me nothing:
我能弄清楚的唯一调试是 enable ADB_TRACE=all
,但这什么也没告诉我:
mkh@MULE ~/AppData/Local/Android/android-sdk/platform-tools
$ export ADB_TRACE=all
mkh@MULE ~/AppData/Local/Android/android-sdk/platform-tools
$ adb devices
system/core/adb/adb.c::main():Handling commandline()
system/core/adb/adb_client.c::adb_query():adb_query: host:devices
system/core/adb/adb_client.c::_adb_connect():_adb_connect: host:version
system/core/adb/sysdeps_win32.c::socket_loopback_client():socket_loopback_client: port 5037 type tcp => fd 100
system/core/adb/transport.c::writex():writex: fd=100 len=4: 30303063 000c
system/core/adb/transport.c::writex():writex: fd=100 len=12: 686f73743a76657273696f6e host:version
system/core/adb/transport.c::readx():readx: fd=100 wanted=4
system/core/adb/transport.c::readx():readx: fd=100 wanted=4 got=4
4f4b4159 OKAY
system/core/adb/adb_client.c::_adb_connect():_adb_connect: return fd 100
system/core/adb/adb_client.c::adb_connect():adb_connect: service host:devices
system/core/adb/transport.c::readx():readx: fd=100 wanted=4
system/core/adb/transport.c::readx():readx: fd=100 wanted=4 got=4
30303034 0004
system/core/adb/transport.c::readx():readx: fd=100 wanted=4
system/core/adb/transport.c::readx():readx: fd=100 wanted=4 got=4
30303164 001d
system/core/adb/sysdeps_win32.c::adb_close():adb_close: 100(lo-client:5037)
system/core/adb/adb_client.c::_adb_connect():_adb_connect: host:devices
system/core/adb/sysdeps_win32.c::socket_loopback_client():socket_loopback_client: port 5037 type tcp => fd 101
system/core/adb/transport.c::writex():writex: fd=101 len=4: 30303063 000c
system/core/adb/transport.c::writex():writex: fd=101 len=12: 686f73743a64657669636573 host:devices
system/core/adb/transport.c::readx():readx: fd=101 wanted=4
system/core/adb/transport.c::readx():readx: fd=101 wanted=4 got=4
4f4b4159 OKAY
system/core/adb/adb_client.c::_adb_connect():_adb_connect: return fd 101
system/core/adb/adb_client.c::adb_connect():adb_connect: return fd 101
system/core/adb/transport.c::readx():readx: fd=101 wanted=4
system/core/adb/transport.c::readx():readx: fd=101 wanted=4 got=4
30303030 0000
system/core/adb/transport.c::readx():readx: fd=101 wanted=0
system/core/adb/transport.c::readx():readx: fd=101 wanted=0 got=0
system/core/adb/sysdeps_win32.c::adb_close():adb_close: 101(lo-client:5037)
List of devices attached
***NOTHING SHOWN*****
What am I doing wrong?
我究竟做错了什么?
回答by Mike Hanafey
When the Nexus 7 is plugged in there is a persistent notification that indicates "CONNECT AS / Media Device (MTP)". In this state adb devices
will not show the Nexus, or undoubtedly any other device. Not exactly obvious, but if you select the second option "Camera (PTP)" the device is available for debugging (the lesson is ignore the camera, and focus on the protocol PTP).
当 Nexus 7 插入时,会显示一条持续通知,指示“ CONNECT AS / Media Device (MTP)”。在这种状态下adb devices
不会显示 Nexus,也不会显示任何其他设备。不是很明显,但是如果您选择第二个选项“Camera (PTP)”,该设备可用于调试(课程是忽略相机,并专注于协议 PTP)。
This configuration is persistent, and I'm guessing that with a brand new device it will connect as MTP until told otherwise.
这种配置是持久的,我猜对于一个全新的设备,它将作为 MTP 连接,除非另有说明。
Thanks to @Ciaran GallagherSettings --> Storage --> Top Left Option (Computer USB Connection) tap--> choose MTP
感谢@Ciaran GallagherSettings --> Storage --> Top Left Option (Computer USB Connection) tap--> choose MTP
回答by Zack Dawood
Check out blog post Nexus 7 Android developmentwhich has the steps in detail.
查看博客文章Nexus 7 Android 开发,其中包含详细的步骤。
回答by MotohawkSF
In addition to setting USB connection/storage mode to "Camera (PTP)", I also had to enable developer mode, which has been hidden since 4.2.
除了将USB连接/存储模式设置为“相机(PTP)”之外,我还必须启用从4.2开始隐藏的开发人员模式。
- Go to the Settings menu, and scroll down to 'About phone/tablet'. Tap it.
- Scroll down to the bottom again, where you see 'Build number'.
- Tap it seven (7) times. After the third tap, you'll see a playful dialog that says you're four taps away from being a developer. Keep on tapping and you've got the developer settings.
- Now under Settings there's 'Developer options'. Tap it.
- Tap 'USB debugging' to enable it.
- 转到“设置”菜单,然后向下滚动到“关于手机/平板电脑”。点击它。
- 再次向下滚动到底部,您会看到“内部版本号”。
- 点击它七 (7) 次。第三次点击后,您会看到一个有趣的对话框,提示您距离成为一名开发者还有四次点击。继续点击,您将获得开发人员设置。
- 现在在“设置”下有“开发人员选项”。点击它。
- 点击“USB调试”以启用它。
回答by Danpe
To fix/install Android USB driver on Windows 7/8 32bit/64bit:
在Windows 7/8 32bit/64bit上修复/安装 Android USB 驱动程序:
- 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 (Nexus 7/ Nexus 5/ Nexus 4) and select Update Driver Software. This will launch the Hardware Update Wizard.
- Select Browse my computer for driver softwareand click Next.
- Click Browseand locate the USB driver folder. (The Google USB
Driver is located in
<sdk>\extras\google\usb_driver\
.) - Click Nextto install the driver.
- 将 Android 设备连接到计算机的 USB 端口。
- 在桌面或 Windows 资源管理器中右键单击“计算机”,然后选择“管理”。
- 在左侧窗格中选择设备。
- 在右侧窗格中找到并展开其他设备。
- 右键单击设备名称(Nexus 7/ Nexus 5/ Nexus 4)并选择更新驱动程序软件。这将启动硬件更新向导。
- 选择浏览我的计算机以查找驱动程序软件,然后单击下一步。
- 单击浏览并找到 USB 驱动程序文件夹。(Google USB 驱动程序位于
<sdk>\extras\google\usb_driver\
。) - 单击下一步安装驱动程序。
If it still doesn't work try changing from MTPto PTP.
如果它仍然不起作用,请尝试从MTP更改为PTP。
回答by Amos
I discovered that you can also do Device Manager -> Update Driver Software -> Browse my computer for driver software -> Let me pick from a list of device drivers on my computer -> Android Phone -> [ADB driver version 6 near top of list... sorry, I can't remember exact name]
我发现您还可以执行设备管理器 -> 更新驱动程序软件 -> 浏览我的计算机以查找驱动程序软件 -> 让我从计算机上的设备驱动程序列表中选择 -> Android 手机 -> [ADB 驱动程序版本 6 靠近顶部列表...抱歉,我不记得确切的名字]
As soon as I did that, it connected, and I was able to sideload version 4.2 on Windows 7 64 bit.
一旦我这样做了,它就连接了,我能够在 Windows 7 64 位上旁加载 4.2 版。
回答by dotrc
I'm using Nexus 7 (4.2) on Windows 7 x64. None of the other methods described here worked for me. The tab was already in PTP mode. Finally, I could get it working when I added the below line to 'android_winusb.inf' under <android-sdk>\extras\google\usb_driver and did an 'update driver':
我在 Windows 7 x64 上使用 Nexus 7 (4.2)。这里描述的其他方法都不适合我。该选项卡已处于 PTP 模式。最后,当我将以下行添加到 <android-sdk>\extras\google\usb_driver 下的“android_winusb.inf”并执行“更新驱动程序”时,我可以让它工作:
%CompositeAdbInterface% = USB_Install, USB\VID_18D1&PID_4E44&REV_9999&MI_01
To get the exact hardware ID (USB\VID_18D1&PID_4E44&REV_9999&MI_01 in my case), you can go to Computer Management-> Device Manager-> Detailstab -> select Hardware Id from the drop-down.
要获得确切的硬件 ID(在我的情况下为 USB\VID_18D1&PID_4E44&REV_9999&MI_01),您可以转到计算机管理->设备管理器->详细信息选项卡 -> 从下拉列表中选择硬件 ID。
回答by user1821949
I had a similar issue and tried the other suggestions.
我遇到了类似的问题并尝试了其他建议。
Utilizing the PdaNet driver in the download from http://www.junefabrics.com/android/download.phpis what finally did the job and allowed me to finally connect via ADB. Prior to installing the driver from here I was unable to recognize my Nexus in order to sideload the new Android 4.2 on my device.
在从http://www.junefabrics.com/android/download.php下载的 PdaNet 驱动程序中使用 PdaNet 驱动程序最终完成了这项工作,并让我最终通过 ADB 连接。在从这里安装驱动程序之前,我无法识别我的 Nexus 以便在我的设备上加载新的 Android 4.2。
I am running Windows 7 64 bit with my Nexus 7.
我正在使用 Nexus 7 运行 Windows 7 64 位。
回答by Akshay
回答by seattleandrew
I had similar problems and I found that unchecking all of the options (both MTP and PTP) allowed the device to get the RSA Fingerprint from my computer and after that point "adb devices" worked.
我遇到了类似的问题,我发现取消选中所有选项(MTP 和 PTP)允许设备从我的计算机获取 RSA 指纹,然后“adb 设备”工作。
Keep in mind, the RSA fingerprint is required to be accepted before an Android 4.2+ device can connect via ADB, this is obviously for security reasons.
请记住,在 Android 4.2+ 设备可以通过 ADB 连接之前,需要接受 RSA 指纹,这显然是出于安全原因。
回答by user3078188
I also have a Nexus 7 and Windows 7 64-bit and got ADB working by stumbling around in this thread and others about a month ago. Then it stopped working. The only thing odd I remember happening before was Windows installing some Bluetooth drivers as I started up (I do not have Bluetooth devices).
我还有一个 Nexus 7 和 Windows 7 64 位,大约一个月前通过在这个线程和其他线程中绊倒,让 ADB 工作。然后它停止工作。我记得之前发生的唯一奇怪的事情是 Windows 在我启动时安装了一些蓝牙驱动程序(我没有蓝牙设备)。
I floundered for a day this time. Now it is working again! The last thing I did was to use Device Manager to "disable" the device and reboot.
这次我折腾了一天。现在它又开始工作了!我做的最后一件事是使用设备管理器“禁用”设备并重新启动。