FORUMS
Remove All Ads from XDA

[FIX] MTP with USB debugging / ADB within Recovery (windows/nexus7)

5,342 posts
Thanks Meter: 7,234
 
By sfhub, Senior Member on 3rd August 2013, 10:31 PM
Post Reply Email Thread
The MTP fix is ONLY for the STOCK ROM and handles the case
  • USB debugging disabled - MTP working
  • USB debugging enabled - MTP not recognized
If you cannot get MTP working at all, I suggest you
  1. uninstall your current device drivers
    using device manager/devmgmt.msc or Nirsoft USBDeview
    you may want to
    • set devmgr_show_nonpresent_devices=1
    prior to starting devmgmt.msc and
    • view hidden devices within devmgmt.msc
  2. REBOOT
  3. reinstall

The ADB fix is for getting ADB to work while in Recovery (tested on stock and twrp).

Google USB device drivers can be found here:
Nirsoft USBDeview can be found here:====

MTP mode (with USB debugging enabled)

I got tired of having to disable USB debugging to get the MTP device recognized.

This happens because the USB ID for the MTP device changes when USB debugging is turned on and isn't recognized by windows anymore. The particular problem is the compatible IDs list from the tablet is not advertising USB\MS_COMP_MTP when USB debugging is enabled and windows doesn't know to use the MTP drivers.

I created the following driver .inf file to fix the problem so you can have usb debugging enabled and still have MTP working.

I only tested it on Windows XP.

This ONLY fixes the problem where MTP works with USB debugging DISABLED, but stops working when you have USB debugging ENABLED.

If you can't get MTP working under any circumstance, you have some other problem. Try
  • double checking
    Settings->Storage->3 dots->USB computer connection->Media device (MTP) is enabled
  • removing your drivers using Nirsoft USBDeview and rebooting
When you turn on USB debugging and windows asks for an MTP driver, just provide the following and it should install the driver hooks and start recognizing the MTP device from that point on.

Let me know if there are any issues and I'll try to address.
  • mtp_driver.zip is for USB debugging enabled and stock ROM
INFO: this same method of fixing the unrecognized IDs might not work for custom ROMs. I have forced the MTP USB ID for a custom ROM to be recognized and it does so successfully, but when the windows MTP driver tries to initialized the device, it fails. This indicates there may be additional issues with the MTP support on the custom ROM side.

====

ADB support (within Recovery)

I wanted to get adb working in TWRP and adb sideload working in stock recovery but adb wasn't recognizing the device.

Here we have the same problem as above. The USB IDs for the ADB interface change when you are running Recovery and are no longer recognized by the driver. You'll notice that when you are running TWRP you will see an unknown device called "flo". This is actually the ADB USB interfaced but windows doesn't know that.

I created a simple fix for this problem. Just download the official Google USB/ADB drivers from above. Then download android_winusb.inf.zip from the attachment. Unzip the Google drivers and replace the android_winusb.inf file in the Google drivers with the one in the attachment.
  • android_winusb.inf.zip - unzip this file to get android_winusb.inf. Replace the file of the same name in the Google USB drivers with the one in this zip file
If you feel replacing a file is too complicated, the following attached file has all the changes done for you. Just unzip to get the adb_driver folder, right-click on the "flo" device, choose install drivers, and point the driver install to the adb_driver folder
  • adb_driver.zip - if you want everything already done for you, this file includes the driver inf and the driver so you don't need to replace anything. This will work for adb within both Android and Recovery.
  • platform_tools.zip - this is adb 1.0.31 that supports RSA identification introduced in Android 4.2.2
====
Attached Files
File Type: zip mtp_driver.zip - [Click for QR Code] (884 Bytes, 35617 views)
File Type: zip android_winusb.inf.zip - [Click for QR Code] (1.2 KB, 16235 views)
File Type: zip adb_driver.zip - [Click for QR Code] (8.27 MB, 26775 views)
File Type: zip platform-tools.zip - [Click for QR Code] (542.8 KB, 11249 views)
The Following 31 Users Say Thank You to sfhub For This Useful Post: [ View ] Gift sfhub Ad-Free
11th August 2013, 05:40 PM |#2  
Senior Member
Anchorage
Thanks Meter: 55
 
More
Wow or strange should be more of the reply. I have done this before but it never worked. Thanks for the help. For anyone else needing help here is what I did. First opened the Nexus Tool Kit, then Full Driver Installation Guide, launched USBDeview, then - In particular look for devices with Vendor ID - "18d1" or... "04e8" - Simply right click these devices, and select the option to: - "Uninstall Selected Devices", final step unplugged the device and plugged it back in and it worked. Also MTP enabled USB Debug unchecked. Thanks again...

-AkWingnut
12th August 2013, 03:13 PM |#3  
dakunclear's Avatar
Senior Member
Flag Calgary
Thanks Meter: 234
 
More
Quote:
Originally Posted by sfhub

This fix is ONLY for the STOCK ROM and handles the case

  • USB debugging disabled - MTP working
  • USB debugging enabled - MTP not recognized
If you cannot get MTP working at all, I suggest you uninstall your current device drivers (using device manager/devmgmt.msc) and reinstall.

Google USB device drivers can be found here:====

I got tired of having to disable USB debugging to get the MTP device recognized.

This happens because the USB ID for the MTP device changes when USB debugging is turned on and isn't recognized by windows anymore. The particular problem is the compatible IDs list from the tablet is not advertising USB\MS_COMP_MTP when USB debugging is enabled and windows doesn't know to use the MTP drivers.

I created the following driver .inf file to fix the problem so you can have usb debugging enabled and still have MTP working.

I only tested it on Windows XP.

This ONLY fixes the problem where MTP works with USB debugging DISABLED, but stops working when you have USB debugging ENABLED.

If you can't get MTP working under any circumstance, you have some other problem.

When you turn on USB debugging and windows asks for an MTP driver, just provide the following and it should install the driver hooks and start recognizing the MTP device from that point on.

Let me know if there are any issues and I'll try to address.

mtp_driver.zip is for USB debugging enabled and stock ROM

EDIT: I removed the following file since it appears the issue with MTP on Paranoid is on the ROM side. The USB IDs were different and the driver inf I provided was able to get the windows side to recognize the MTP device and associate the MTP drivers, but when the MTP driver tried to initialize the MTP device, it wasn't responding properly.

mtp_driver_ubdebug_paranoid.zip (experimental) is for USB debugging enabled Paranoid ROM

If you need it just let me know.

There is a easier way if your running Windows 8 go into device manager while the nexus 7 is plugged in it show Google adb interface something like that so click on it and find hardware updates then from there hit manual update it give youa search option and another just pick manual it show the adb one or mtp select the one for mtp and you should be okay I will post pictures later on so it makes it easier to understand my instructions

Sent from my Nexus 7 using xda app-developers app
12th August 2013, 05:53 PM |#4  
OP Senior Member
Thanks Meter: 7,234
 
More
Quote:
Originally Posted by dakunclear

There is a easier way if your running Windows 8 go into device manager while the nexus 7 is plugged in it show Google adb interface something like that so click on it and find hardware updates then from there hit manual update it give youa search option and another just pick manual it show the adb one or mtp select the one for mtp and you should be okay I will post pictures later on so it makes it easier to understand my instructions

Not sure if this is particular to newer versions of windows or you have installed some previous drivers which allow MTP to show up when you do the manual driver install but for winxp even though it has the MTP driver on the system it won't give you the option to use it when you click on Android phone/devices, Portable devices, or Imaging devices categories under the manual driver install option. It just says no compatible drivers.

I'm a little suprised if your win8 install is showing MTP as a compatible driver, why it didn't just auto-install this from the beginning w/o user intervention?

The problem some folks are encountering (at least on older windows) is that since the tablet no longer advertises USB\MS_COMP_MTP in the compatible ID list, windows doesn't know what type of device this is, thus it doesn't provide you with any device drivers to use.
12th August 2013, 07:03 PM |#5  
OP Senior Member
Thanks Meter: 7,234
 
More
Added support for ADB within Recovery (tested on stock and TWRP)
14th August 2013, 11:49 AM |#6  
garwynn's Avatar
Retired Forum Moderator / Inactive Recognized Developer / XDA Portal Team
Flag NE Ohio
Thanks Meter: 8,731
 
Donate to Me
More
Wow!
Welcome back! Hope we held down the fort well enough while you've been away!

Sent from my SPH-L900 using Tapatalk 2
14th August 2013, 12:06 PM |#7  
OP Senior Member
Thanks Meter: 7,234
 
More
Thanks, been a while. Haven't been around to look at the fort yet. Have new toy to play with.
14th August 2013, 03:07 PM |#8  
TrayLunch's Avatar
R.I.P.
Flag Houston
Thanks Meter: 1,852
 
More
Quote:
Originally Posted by sfhub

Thanks, been a while. Haven't been around to look at the fort yet. Have new toy to play with.

Welcome back! It's good to see you deving again!

Stop by the Pub some time. There are plenty there that would love to say "Hi!" to you.

Bugging up my phone, so you don't have to!

Need help? [email protected] on GTalk or by Email
14th August 2013, 09:13 PM |#9  
moparfreak426's Avatar
R.I.P.
Flag East/Middle TN
Thanks Meter: 1,198
 
Donate to Me
More
Quote:
Originally Posted by TrayLunch

Welcome back! It's good to see you deving again!

Stop by the Pub some time. There are plenty there that would love to say "Hi!" to you.

Bugging up my phone, so you don't have to!


Need help? [email protected] on GTalk or by Email

Say hi, pass him a round, and thank him for his work

Sent from my SCH-I535 using Xparent Skyblue Tapatalk 2
16th August 2013, 04:21 AM |#10  
daniel4653's Avatar
Senior Member
Flag Southern California
Thanks Meter: 3,102
 
More
Great to see your work again SFhub! You've been missed.

Sent from my GT-I9505G using Tapatalk 4
27th August 2013, 12:44 AM |#11  
Junior Member
Thanks Meter: 0
 
More
notianag hovels
My New nexus 7 was connected to PC(windows7), USB debugging enabled:
I can see files from the PC.
But adb can't reach Nexus..

D:\>adb version
Android Debug Bridge version 1.0.29

D:\>adb devices
List of devices attached


while I connect my Galaxy SIII to PC, adb works:

D:\>adb devices
List of devices attached
cc05905f device


Anyone have any clue what happen to the Nexus7?

Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes