TracerPlus Desktop supports the Android Debug Bridge (ADB) interface to deploy projects to Android devices. This is an alternate method of deployment for devices that might not support the Media Transfer Protocol (MTP) interface or mapped drives. This is rare; mapped drives as a file management method have been phased out of Android after version 2.3 (Gingerbread), and MTP capability ships with every new Android device since version 4.0 (Ice Cream Sandwich). Even still, having an alternate method of deployment can be handy in the event MTP/mapped drives are not working.
To use ADB, your device must have USB debugging enabled, an option in the Developer Options of your device. You must also have the corresponding ADB USB driver for your device installed on your Windows PC. Unfortunately, not all devices are made equal: often times, you will find that your device manufacturer does not provide an ADB driver for your device, or even when they do, the driver fails to work. This document will help you potentially resolve this issue; we will use the standard Google USB driver and modify it so Windows can recognize your device through the Google driver.
Disclaimer: The following instructions are not guaranteed to work or work correctly. Since you are modifying driver files, Windows may display security warnings. Although we have had success using this method, you may not have the same outcome. If you choose to follow these instructions, you do so at your own risk. PTS is not responsible for rendering your system operable or inoperable.
Install the Google USB driver
First things first: we need to install the Google USB driver. If you use a Google Nexus Android device, you might already have this installed. If not, you can get it at the following location:
Please note that Google recommends looking for/using an OEM driver (the Windows driver by the original equipment manufacturer) first, and you should heed this advice. On the same page, if you click the OEM USB drivers link, you will see a listing of all the Android device manufacturers that provide their own USB driver (the listing will be towards the bottom of the linked page). If you find your device manufacturer on there, go ahead and download that driver. In most cases, that will be sufficient to use ADB. In that case, you can jump ahead to the Enable USB debugging section further below. For everyone else, read on.
When you download the file, you will end up with a zip file containing the driver. To install, unzip the file, and you should see a folder named usb_driver. Copy the folder to a centrally accessible location; the best spot may be something in the root path of the C:\ drive (usually the install location of the Windows OS). Here is an example path:
C:\google usb driver\usb_driver\
- Where google usb driver is a folder you create on the root of the C:\ drive, and place the usb_driver folder we extracted within.
Remember where you put the driver, as we will need to locate it in a few moments.
Enable USB debugging
Before we continue, let’s enable USB debugging on our devices so ADB can communicate with it. To do so, open the Settings app on your device. Scroll to the option named About device, and open it. In here, scroll until you see an item named Build number. Tap on this item 7 times. As you tap, you will see a countdown showing how many taps you have left. After 7 taps, Developer options will become an exposed menu item at the top level of the Settings menu.
It’s possible that the aforementioned instructions don’t work. This may happen with an older Android device. Since Android devices can vary wildly in their UI, it is difficult to provide specific instructions. The Enable USB debugging may exist in the top level Applications menu item in the Settings application. It may also exist in the Security menu item in the Settings application. If all else fails, look up the instructions to enable USB debugging on your specific Android device on the web.
Within the Developer options menu, scroll until you see USB debugging, and select to enable that option.
Retrieve Vendor and Product IDs
To modify the Google USB driver we need the Vendor and Product IDs of our USB device (VID and PID respectively). To retrieve that, connect your Android device to your Windows PC. Windows will show a dialog where it attempts to automatically install the right driver for your device. Most of the time, it fails. Sometimes, it works. If you see a prompt on your Android device asking you to “authorize the PC to access debugging information on the device”, you can select Yes to that dialog, and you’re done: your device is ready to be used with the ADB interface in TracerPlus Desktop. Otherwise, keep reading.
Once your device is connected, open a Run prompt using WINDOWS + R on your keyboard (the WINDOWS key has the Windows logo on it). In the Run prompt, type in devmgmt.msc, and hit Enter: this opens the Device Manager. An alternate way is to search for device manager in Windows search.
Within Device Manager you should see a device listed that has a yellow warning triangle next to it. More often than not, this is your connected Android device (and the triangle means Windows failed to find the right driver for it). You can test it by disconnecting and reconnecting the device with the manager window open; you should see the list item disappear and then reappear.
Right click the device, and select Properties. Then open the Details tab. In the Property dropdown, select Hardware Ids. You’ll see listed the VID and the PID in the following format:
- Where x represents a numeric digit. The items in the brackets represent optional items; you may or may not see these items.
Keep this window open as you will need these IDs in a moment.
Modifying the Google USB driver
Remember the folder where you placed the usb_driver. Locate it now, and open the folder: you’ll see a file named android_winusb.inf (you may not see the .inf file extension, that’s OK). This file will open in Notepad. Scroll until you see an item [Google.NTx86]. Below you will see a number of items that follow the same format.
%SingleAdbInterace% = USB_Install, USB\VID_xxxx&PID_xxxx
%CompositeAdbInterface% = USB_Install, USB\VID_xxxx&PID_xxxx&MI_xx
What we need to do is add our device to this list, with the same format. This is why we needed the VID and PID.
So, add your device name in place of [item name]. You can just use what Windows has listed in the device manager (where you grabbed the VID and PID). Then, add your own VID and PID listings to the AdbInterface items using the following rules.
- If your device has a REV_xxxx ID string as well, add two items for %SingleAdbInterface%, one with the REV ID and one without.
- For the one with the REV ID, add it at the end of the PID like so: USB\VID_xxxx&PID_xxxx&REV_xxxx
- For the %CompositeAdbInterface% item, you will need to add the MI_xx ID at the end, like so: USB\VID_xxxx&PID_xxxx&MI_xx
Once you have added the items, your finished result should look something like this:
;PTS Test Device
%SingleAdbInterface% = USB_Install, USB\VID_0787&PID_8378
%SingleAdbInterface% = USB_Install, USB\VID_0787&PID_8378&REV_1337
%CompositeAdbInterface% = USB_Install, USB\VID_0787&PID_8378&MI_01
I’ve included an example with a REV ID but you may not have one; in that case, you will only have one %SingleAdbInterface% item. Now, take that, and copy the whole item. Scroll down, and you should see an item [Google.NTamd64]. Place the copied item here as well. You don’t need to modify it anymore, but this enables the driver to work in both 32-bit and 64-bit modes in Windows. Once you're done, save this file and exit.
Updating the device driver
This is the last step. Do you still have the Device Manager open? If not, open it. Right click on your device (with the warning triangle). Select Update driver software. Choose Browse my computer for driver software. Click the Browse button, and locate the usb_driver folder. Once you select the folder and hit Next, Windows will attempt to use the Google USB driver and associate it with your Android device. You might see a Windows security warning message during this step. You should select to confirm that you want to install this driver. Once you do that, you will see that Windows will be installing new device drivers. If all goes well, you will see a dialog prompt on your device that asks if you want to “enable the connected PC to access debugging information on the device”. Confirm that you do, and you’re done: you can now use the ADB interface to deploy to your device using TracerPlus Desktop.