Well, I started my Android development on a Samsung I9100 Galaxy S II. I never had any trouble getting ADB to work on Microsoft Windows since I had the drivers from Samsung which was already installed due to my previous Cyanogenmod installation process. Afterwards, I received a Nexus 7 and a bit latter a Nexus 5 which became my primary development device of choice. Google did a good job by providing ADB drivers for All Nexus devices inside the SDK or as a small separate download on Android Developers website which was very easy to install. The trouble began when my development process involved testing my applications and games on devices other than Nexus ones I had. For some manufacturers I was never able to find the drivers. Finding the correct driver for each device was a huge pain until I found a solution that became a remedy for all my troubles getting ADB to work with any Android device, even without the OEM drivers. It even became my preferred alternative to manufacturer’s provided ADB drivers for all my other devices till this day, since I hate the bloat-ware and useless crap they provide along with their drivers which is inevitable to install anyway.
In the rest of this post I’m going to share my easy solution with you:
1. First you have to download Google USB driver which is a small download around 8 MB in size and extract it somewhere. If you have the Android SDK installed it usually resides inside
<sdk root>\extras\google\usb_driver\. So, you do not have to download it separately in that case.
2. Now, you have to find your device’s hardware ID. In order to do that, the first step involves turning on Android Debugging on your device. On some devices it is known as ADB Debugging, USB Debugging or something similar. On your Android device, go to Settings > Developer Options and you should find it there, then check it. If you do not have Developer Options inside Settings, you must go to Settings > About Phone and tap on Build Number 7 times repeatedly. A pop-up should appear and tell you that you have enabled developer options. Now, go back to Settings and you will find it there right before About Phone.
3. Then, connect your device to your Windows PC and on your PC go to Control Panel > Device Manager. You will find your device with a yellow exclamation mark. As an example, on one of my devices it’s ‘TP9.7-1500DC’ and on the other one it’s ‘IdeaTab S6000’ or simply ‘Android’ for another device (check Figure 3. below). Right click on your Android device name with yellow exclamation mark and click Properties. A window with a few tabs will appear. Go to the Details tab and inside Property combo box look for Hardware Ids and select it. You will find the Hardware Ids inside the Value section below the Property combo box that you’ve just used to find the IDs (Figure 4.). Now, right click on one of the IDs inside the Value box and hit Select All to select all the Hardware Ids. After selecting all the IDs, once more right click on one of the selected IDs and choose Copy. You’ve just got all the Hardware Ids for your Android device.
Here is a list of some of my devices with their Hardware Ids:
;Nexus 4 USB\VID_18D1&PID_4EE2&REV_0228&MI_01 USB\VID_18D1&PID_4EE2&MI_01 ;Motorola Moto G USB\VID_22B8&PID_2E76&REV_0228&MI_02 USB\VID_22B8&PID_2E76&MI_02 ;Motorola Networking Interface USB\VID_22B8&PID_2E82&REV_0228&MI_01 USB\VID_22B8&PID_2E82&MI_01 ;i.onik TP9.7-1500DC Retina USB\VID_2207&PID_0006&REV_0222 USB\VID_2207&PID_0006 ;Sony Xperia M Dual C2005 USB\VID_0FCE&PID_519B&REV_0228&MI_01 USB\VID_0FCE&PID_519B&MI_01 ;Lenovo IdeaTab S6000-H USB\VID_17EF&PID_75E2&REV_0255&MI_01 USB\VID_17EF&PID_75E2&MI_01 ;Samsung Galaxy S4 GT-I9500 USB\VID_04E8&PID_6860&REV_0400&ADB USB\VID_04E8&PID_6860&ADB USB\SAMSUNG_MOBILE&ADB USB\SAMSUNG_MOBILE&MI_03 USB\Vid_04E8&Pid_6860&MI_03 USB\Vid_04E8&Pid_6860&Class_FF&SubClass_42&Prot_01 USB\SAMSUNG_MOBILE&Class_FF&SubClass_42&Prot_01 ;Samsung Galaxy S4-mini GT-I9190 USB\VID_04E8&PID_6860&REV_0400&ADB USB\VID_04E8&PID_6860&ADB USB\SAMSUNG_MOBILE&ADB USB\SAMSUNG_MOBILE&MI_01 USB\Vid_04E8&Pid_6860&MI_01 USB\Vid_04E8&Pid_6860&Class_FF&SubClass_42&Prot_01 USB\SAMSUNG_MOBILE&Class_FF&SubClass_42&Prot_01 ;HUAWEI G610-U20 USB\VID_12D1&PID_1038&REV_0255&MI_01 USB\VID_12D1&PID_1038&MI_01 ;HUAWEI U8950-1 USB\VID_12D1&PID_1038&REV_0231&MI_01 USB\VID_12D1&PID_1038&MI_01 ;Samsung Note 10.1 SM-P6012 USB\VID_04E8&PID_6860&REV_0400&ADB USB\VID_04E8&PID_6860&ADB USB\SAMSUNG_MOBILE&ADB USB\SAMSUNG_MOBILE&MI_03 USB\Vid_04E8&Pid_6860&MI_03 USB\Vid_04E8&Pid_6860&Class_FF&SubClass_42&Prot_01 USB\SAMSUNG_MOBILE&Class_FF&SubClass_42&Prot_01 ;HTC Desire 616 dual sim Android Phone USB\VID_0BB4&PID_0EDD&REV_0216&MI_01 USB\VID_0BB4&PID_0EDD&MI_01
4. In this step make a copy of your Google USB Driver that you’ve just downloaded or took from your Android SDK folder. There must be a file named _androidwinusb.inf inside that folder. Open that up inside your favorite text editor. It utilizes Windows INF format. An untouched copy of that file looks like this:
5. Look for [Google.NTx86] and [Google.NTamd64] sections inside the file. Remember the Hardware Ids that we have just copied to clipboard? We have to add them to the end of these sections to be able to install the driver on both x86 and x64 versions of Windows. But the point is, you cannot simply paste them here. For each line of hardware ID we’ve got, we have to add _‘%CompositeAdbInterface% = USBInstall, ‘ at the beginning of them. Optionally you can add comments starting with a semicolon ’;’ character for each device. OK, if this is all confusing, considering my previously provided list of Hardware Ids, the modified file looks like this (I’m sure it’s self-explanatory if you look for my comments and compare them to both the original file and the list of Hardware Ids):
6. Now we are good to go. With Settings > Developer Options > Android Debugging checked and your device still connected, go back to your Control Panel > Device Manager on your PC and right click on your Android device name with the yellow exclamation mark, then choose Update Driver Software… and follow the on-screen instructions. It will ask for your driver’s location and you must provide it with the modified driver’s directory. If you’ve done everything right, Windows should be able to detect the device and warn you with the following window (Figure 5.):
7. This happens because by comparing the hash of the file, Windows knows that the file has changed. And since these changes are not from Google, for security reasons, it warns the user. We know we changed that file, right? So, proceed with the installation by hitting the Install this driver software anyway button. Note on Windows 8, 8.1 and probably 10, due to stricter security policies you won’t be able to install the modified driver, even though you have chose Install this driver software anyway option. We will come to that later, and I’ll show you a way to bypass that too.
8. Once more check Control Panel > Device Manager to see if the driver installation was successful (Figure 6.).
9. The last step is to verify whether ADB recognizes the Android device or not, using
adb devices command (Figure 7.):
Windows 8 / 8.1 / 10 instructions: OK, if you are on Windows 8 or newer versions of Windows, disable Driver Signature Enforcement before installing the modified driver by following these steps (note that it requires a reboot on your PC):
Step 1: Press
WIN_KEY+C to open the Charm menu or by moving your mouse courser to the lower right edge of the screen and then click the gear icon also known as Settings:
Step 2: Select Change PC Settings:
Step 3: Select Update and Recovery:
Step 4: Select Recovery, then Restart now in the Advanced startup section:
Step 5: Click on Troubleshoot button:
Step 6: Click on Advanced options button:
Step 7: Click on Startup Settings button:
Step 8: Click on Restart button to reboot your PC:
Step 9: After rebooting your PC you will see the following screen. Press
F7 on your keyboard to boot with Driver Signature Enforcement feature disabled:
Step 10: Go to Control Panel > Device Manager and proceed to the driver installation as described in the main driver installation process, steps 6 to 9 (where you’ll get the Windows Security warning, Figure 5.). Please note that after rebooting your PC, Driver Signature Enforcement will be enabled again. So, you don’t have to enable it manually.