Nexus 7 not visible over USB via "adb devices" from Windows 7 x64
I have done the obvious -- the USB driver was installed from the latest Android SDK, and USB debugging was turned on in the tablet.
When the Nexus 7 is connected, the device shows up in the Windows Device Manager as "Android Phone" / "Android Composite ADB Device", with the properties showing driver version 6.0.0.0, so the correct driver is installed and working.
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".
The problem is that "adb devices" shows no devices, and Eclipse also (not surprisingly) also does not offer the Nexus 7 as a hardware device to run an app on.
I have rebooted both devices without effect.
The only debugging I can figure out is enable ADB_TRACE=all
, but this tells me nothing:
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?
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).
This configuration is persistent, and I'm guessing that with a brand new device it will connect as MTP until told otherwise.
Thanks to @Ciaran Gallagher Settings --> Storage --> Top Left Option (Computer USB Connection) tap--> choose MTP
查看博客文章Nexus 7 Android开发详细步骤。
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.
Source: How to enable developer settings on Android 4.2
链接地址: http://www.djcxy.com/p/60678.html