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!

21 comments:

  1. Thank you very much this was driving me nuts!!

    ReplyDelete
  2. Thankyou for this guide. It has helped me immensely!

    ReplyDelete
  3. Unfortunately, this does NOT work for me:
    C:\WINDOWS\system32>bcdedit -set TESTSIGNING ON
    An error has occurred setting the element data.
    The value is protected by Secure Boot policy and cannot be modified or deleted.

    ReplyDelete
    Replies
    1. Gosh, maybe you can skip that bcdedit section and see what happens.

      Delete
    2. Leif, I had the same problem attempting to use the bcdedit command. To disable driver signing, follow the procedure described here instead: http://revryl.com/2013/08/06/install-unsigned-drivers/

      worked for me with no issue after adding my hardware ids to the .inf file per step 3 above. Good luck!

      Delete
  4. Leif, have you tried running cmd.exe as an administrator?

    ReplyDelete
  5. Just wanted to say that this post helped greatly, but I don't get the whole bcdedit thing. I had 2 devices that I needed to start working on my new computer. For the phone, I used this method with the bcdedit command and restarting to get it to work. But for the tablet, I followed a similar tutorial found here http://stackoverflow.com/a/19839812/2089675. And without the whole command line fiasco, the tablet started working as well.

    ReplyDelete
    Replies
    1. I don't know :) Maybe mine didn't need bcdedit too?

      Delete
  6. great. after searching and trying many solutions this one worked..

    ReplyDelete
  7. Wow. awesome tutorial. It has helped me greatly. Thank you very much. It worked on my Windows 8.1 64bit with Huawei android phone.

    ReplyDelete
  8. Thanks a lot. It works!!! BTW, in 3rd big step, "NTamd86" in "Look for [Google.NTamd86], and insert the same lines, for example" should be "NTamd64".

    ReplyDelete
    Replies
    1. Interesting, mine has only [Google.NTamd86] though

      Delete
  9. One more question, what is Step 6 for?

    ReplyDelete
    Replies
    1. It's to enable back driver signing for the safety of your computer :)

      Delete
  10. Thank you very-very-very much!

    I tried it under Win7 64, and it worked.

    ReplyDelete
  11. thank you so much, this help me!

    ReplyDelete
  12. There are numerous mistakes that may show up with this procedure, and these setup.exe blunders can be avoided with some basic strides that take next to no time or exertion. Keeping these mistakes can ease a considerable measure of exacerbation and make your framework run all the more productively. ABD Setup

    ReplyDelete