Tuesday 21 September 2010

ADB driver installation fails after ROM update or change

Sometimes, after changing the ROM in an Android device, ADB will not detect the phone when you plug it in.
This can happen because:
  1. The rom is a different OS version and there an updated driver version exists, so you will need to update your SDK.
  2. The update changed your device's PID (Product ID) and/or VID (Vendor ID). These two values are used in USB devices to identify them and to select the correct drivers for them.
In the second case, you can modify the inf file which comes with the Android drivers to associate it with the new VID/PID.



How to find the new VID/PID in Windows 7:
1. Go to the device manager (hit the start button, and type "Device Manager" to find it).
2. Double-click on ADB, under Android Devices and select details.

3. From the combobox select "Hardware Ids" and write down the VID and PID values. For example, in the screenshot below, my PID is 0BB4 and my VID is 0C99.

How to find the new VID/PID in Windows XP:
The procedure is the mostly the same in XP.
The only differences are how to open the Device Manager (Control Panel -> System -> Hardware -> Device Manager), and that instead of "Hardware Ids" in the ADB properties look for "Device Instance ID" in the combobox.

Changing the VID/PID values in the ADB driver's .inf file:
1. Go to the folder which has the driver (it should be %somewhere%\android-sdk-windows\usb_driver).

2. Make a backup of android_winusb.inf and open the original using a simple text editor (notepad, notepad++, etc).

3. Right at the end of the [Google.NTx86] or the [Google.NTamd64] section (depending on whether you are 32bit or 64bit), paste the following, replacing <YOUR_PID> and <YOUR_VID> with the hex values you wrote down before:

 ; MY PHONE SETTINGS  
 %SingleAdbInterface%    = USB_Install, USB\VID_<YOUR_VID>&PID_<YOUR_PID>  
 %CompositeAdbInterface%   = USB_Install, USB\VID_<YOUR_VID>&PID_<YOUR_PID>&MI_01  
 %SingleBootLoaderInterface% = USB_Install, USB\VID_<YOUR_VID>&PID_0FFF  

Now, unplug and plug the phone and install the driver normally when it asks you to, by pointing the wizard to the ADB drivers directory.

3 comments:

  1. Brilliant this was just what I needed - it solved my problem of connecting my HTC Legend. (:

    ReplyDelete
  2. Doesn't seem to work for me at all. Cannot get the phone recognised

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete