ChatGPT解决这个技术问题 Extra ChatGPT

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?

Go to Settings -> About tablet. Tap on "Build number" seven times. Voila.
After you tap build number 7 times, you will see new option called 'Developer Options' in the setting. From there I also had to enable USB debugging. Developer Options > USB Debugging.
Worth adding if all else fails try another USB cable! I had Developer mode USB debugging on and tried all the Storage USB options but a simple change of a cable was what was needed.

C
Community

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


For anyone else wondering about how to switch to Camera mode, go to 'Settings', then in the 'Device' section, click 'Storage', then click the ellipse on the right-hand side of the header pane, and click 'USB computer connection', then in the 'Connect As' section, check the 'Camera (PTP)' option, then it will work.
Can't seem to make it work on nexus 7. Changed connection type, adb kill-server, adb start-server, adb devices and still list is empty.
Thanks a lot for this tip! Now my question would be, why is this necessary in the Nexus 7 but not in other Android devices? For example, you can use ADB with a GALAXY S3 phone in MTP mode with no problem. It shows up with "adb devices". So why is PTP needed for the Nexus?
@OMA I am absolutely certain that, until just about a month ago, adb DID work perfectly in MTP mode on both Nexus 7 devices on my development system. In fact adb STILL works in MTP mode on my older dev system. It started failing on BOTH of my Nexus 7 devices (2012 and 2013) at the same time, pointing to a change on the Windows side. I installed the Kindle Fire HDX adb drivers at about the time it started failing. Coincidence?
@OMA Further update: I needed to pick up an NVidia Shield and test my app on it, but it doesn't HAVE a PTP mode. It didn't show up, just as I expected (given that none of my other devices were showing up in MTP mode on that dev system). A little fiddling around with the .inf file along with deleting and reinstalling drivers eventually got it working in MTP mode. I think it was switching the matching device ID from "CompositeAdbInterface" to "SingleAdbInterface" that did the trick, though I couldn't swear to it.
P
Peter Mortensen

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.

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.

Source: How to enable developer settings on Android 4.2


D
Danpe

To fix/install Android USB driver on Windows 7/8 32bit/64bit:

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 software and click Next. Click Browse and locate the USB driver folder. (The Google USB Driver is located in \extras\google\usb_driver\.) Click Next to install the driver.

If it still doesn't work try changing from MTP to PTP.

https://i.stack.imgur.com/XZIir.png


P
Peter Mortensen

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]

As soon as I did that, it connected, and I was able to sideload version 4.2 on Windows 7 64 bit.


P
Peter Mortensen

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 \extras\google\usb_driver and did an 'update driver':

%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 -> Details tab -> select Hardware Id from the drop-down.


u
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.php is 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.

I am running Windows 7 64 bit with my Nexus 7.


s
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.

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.


P
Peter Mortensen

Try this. If your device is not getting detected, use PdaNet. You can download it from here. Download it and install on your machine. Connect your phone. It automatically detects the driver from Internet.


u
user1908464

PDANet driver was the only solution for me to successfully connect to Google Galaxy Nexus 4.2.1 on Windows 7 x64 which was rejecting/ignoring official USB drivers from the latest 4.2 ADK (revision 7) - http://junefabrics.com/android/index.php


P
Peter Mortensen

In my case I had two problems:

My PC got a previous "Samsung Galaxy II" driver and assigned it to my Nexus 7. I needed uninstall it many times. Finally I could bind the correct Nexus 7 driver. The need to set the PTP option.


P
Peter Mortensen

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).

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.


P
Peter Mortensen

I had an HTC One driver installed, and I thought that was the reason for not working. However, it turned out that the reason was I disabled both MTP/PTP.

I did not find the place for the settings, but then I found How to Configure the USB on Your Nexus 7.

It's quite confusing to me, it is in the Storage tab. Either MTP or PTP works for me.


P
Prophet

Another option is if windows updates are turned totally off on your PC. In this case even if you download the USB driver & try update it manually as described above it will not work. The only way in this case is enabling windows updating drivers automatically. Once you enabled this, remove the non-working driver from device manager & connect you tablet to the PC via USB cable. The drivers will be automatically downloaded & installed by Windows. This way worked on my Windows 7 PC.


G
Gilson

I'm on Win 7 64-bit and I see that most people with the same problem here also on 64-bit. To rule out the hardware and the OS, I used VMware to run Win 7 32-bit on the same PC. Except for having to edit the .inf file with the correct VID/PID everything else went perfectly on Win 7 32-bit so that tells me the PC is fine and Win 7 32-bit is fine also.

Going back to my Win 7 64-bit none of the suggestions above worked for me. However I noticed one thing though, ADB is installed under Program Files (x86) but the driver installer is installing the 64-bit. Win 7 64-bit is recognizing the Nexus 7 as Android Composite ADB Interface but ADB does not detect it.

So is there an ADB 64-bit version somewhere? if my installation is under (x86) on Win 7 64-bit, does it mean I messed up with the installation somewhere.

Would my problem be related to USB drivers 64-bit installed but ADB is 32-bit?

Another issue I noticed when the Nexus 7 USB driver gets installed in the Properties I only see Android Composite ADB Interface for device functions. Under Win 7 32-bit Properties is showing 3 device functions.

https://i.stack.imgur.com/1eKZY.png

it looks like the issue is the USB driver still.


C
Community

Complete checklist:

Enable debugging onto the device Select USB Connection as PTP (camera) Install the driver from http://developer.android.com/sdk/win-usb.html


C
Chris Brown

The solution that seemed to fix this for me, on top of PTP, is not selecting Always allow from this computer when allowing USB debugging. Revoking the authorisations and manually accepting each time the device is connected fixed this for me. (Settings -> Developer options -> Revoke USB debugging authorisations)


J
Jack Ukleja

For those of you who with Nexus 5x who only see Kedacom usb device in Device Manager and cannot get adb to see the phone...the trick is to Update driver... on the Kedacom device and change it to "Android ADB interface/device"


关注公众号,不定期副业成功案例分享
Follow WeChat

Success story sharing

Want to stay one step ahead of the latest teleworks?

Subscribe Now