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:
- 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.
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.
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:
- 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 android_winusb.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:
- 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% = USB_Install, ’ 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):
- 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.):
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.
Once more check Control Panel > Device Manager to see if the driver installation was successful (Figure 6.).
- The last step is to verify whether ADB recognizes the Android device or not, using
adb devicescommand (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.