Thursday, October 17, 2013

Installing Android ADB driver in Windows 8.1 64-bit when all else fails

For some reason I just couldn't get my machine to recognize Xperia J in Windows 8.1 64-bit. Even after installing latest Sony PC Companion (2.10.174).  Device Manager kept showing yellow exclamation mark to an 'Android'.

Here's the solution, but I don't promise it will work on your device!

1. Find out your device's VID and PID

  1. Open Device Manager, right-click that Android with yellow exclamation mark and click Properties.
  2. Go to Details tab.
  3. In Property, select Hardware Ids.
  4. Right-click the value and click Copy.
  5. Paste the value somewhere.


2. Download Android USB Driver

  1. Run Android SDK Manager.
  2. Expand Extras, tick Google USB Driver, click Install packages.
  3. After installation, look for the driver location by hovering mouse over Google USB Driver. The location will appear in the tooltip.


3. Modify android_winusb.inf

  1. Go to the usb driver location, for example in the above picture it is c:\Android\android-studio\sdk\extras\google\usb_driver
  2. Make a backup copy of android_winusb.inf
  3. Open android_winusb.inf with a text editor. Notepad is fine but Notepad++ is better, it will syntax highlight the inf file!
  4. Look for [Google.NTx86], and insert a line with your device's hardware ID that you copied above, for example
  5. [Google.NTx86]
    
    
    
    ; ... other existing lines
    
    
    
    ;SONY Sony Xperia J
    %CompositeAdbInterface% = USB_Install, USB\VID_0FCE&PID_6188&MI_01
    
    
  6. Look for [Google.NTamd86], and insert the same lines, for example:
  7. [Google.NTamd64]
    
    
    
    ; ... other existing lines
    
    
    
    ;SONY Sony Xperia J
    %CompositeAdbInterface% = USB_Install, USB\VID_0FCE&PID_6188&MI_01
    
    
  8. Save the file.

4. Disable driver signing

  1. Run Command Prompt as an administrator
  2. Paste and run the following commands:
    bcdedit -set loadoptions DISABLE_INTEGRITY_CHECKS
    bcdedit -set TESTSIGNING ON
    
    
    
    
    
  3. Restart Windows.

5. Install driver

  1. Open Device Manager, right-click that Android with yellow exclamation mark and click Update Driver Software.
  2. Click Browse my computer for driver software.
  3. Enter or browse to the folder containing android_winusb.inf, eg: C:\Android\android-studio\sdk\extras\google\usb_driver
  4. Click Next.
  5. The driver will install.
  6. Run adb devices to confirm your device is working fine.

6. Re-enable driver signing

  1. Run Command Prompt as an administrator
  2. Paste and run the following commands:
    bcdedit -set loadoptions ENABLE_INTEGRITY_CHECKS
    bcdedit -set TESTSIGNING OFF
    
    
    
  3. Restart Windows.
  4. Run adb devices to reconfirm!