Today I’m gonna tell you how to deal with Nexus 5 and its driver issues with ADB. I have experienced this by myself (wasn’t able to deploy my app because ADB didn’t see my Nexus 5) and it is quite an unpleasant situation, as instead of debugging apps you have to stick for maybe 2h of troubleshooting and connecting/disconnecting the device.
This tutorial’s solution is for Windows only. See this link for Linux and Mac configuration.
Here I will actually provide a few solutions – from the easiest and most obvious ones to those more complicated and time-consuming. The best approach is to go from one to another, sequentially. This way you won’t unnecessary waste time if the problem is in USB debugging, for instance 🙂 So, lets begin!
The first thing to check is USB debugging switch in Developer options. To enable Developer options you need to tap 7 times on Build number (Settings – About phone – Build number). After you get back to Settings view, you should see Developer options just above About phone. Go inside and check USB debugging. If you do it for the first time (or the first time on this particular OS), you will get a Allow USB debugging? dialog view. Press OK and check the Always… option if you plan to regularly debug apps on this computer. Whether you’re not sure you have allowed or cancelled USB debugging, you can always press Revoke USB debugging authorization below USB debugging option.
Connect as Camera/Media device
This solution have appeared here and there as a general remedium for Android device visibility. It is mostly useful if you can’t access Nexus 5’s file manager at all (for example, to copy something), but it won’t hurt to try anyway.
Connect the device through USB and go to Settings – Storage – USB computer connection (in ActionBar overflow menu) – check Camera (PTP). If you already have Camera checked, try checking Media device instead.
Install USB driver manually
To install Google’s USB driver manually, you have to know where you can find one. If you have downloaded Android Studio with Android SDK, you can navigate to SDK manager. There will be an SDK path displayed, like on the screenshot below:
Same with Eclipse actually.
If you have downloaded SDK alone, well, find it by name in Explorer. Probably it will be in the root directory or in Program Files.
After you have tracked SDK’s location (in my case it is C:Program Files (x86)Androidandroid-studiosdk), go to extrasgoogleusb_driver directory. Copy the path.
You can also download Google USB Driver here.
Now, when you know your driver’s location, connect the device and navigate to Device Manager. Find the unknown device/Nexus 5 and choose Update Driver software. Choose Browse my computer for driver software and insert the path you have just copied. Re-connect the phone if necessary.
You can also try to uninstall an already installed driver, if the steps above didn’t help.There is also a way to remove a cached version of a driver. Just take a look at the reply here, dated Nov 22, 2013; Step 3- Open a Windows Explorer and navigate…
Modify USB driver
Unfortunately, if nothing helped so far, you will have to modify USB driver yourself. This is not that difficult and quite fast as well.
First of all, you need to find out hardware ids for Nexus 5. Connect the phone and grab ids values from Device Manager – Nexus 5 device – (right click) Properties – Details tab – Hardware Ids dropdown option (after step 3, Nexus 5 should be detected even if ADB still doesn’t see it).
And now – open android_winusb.inf file. You will see the list of Google drivers for both x86 and x64 platforms. Based on your OS version, insert following lines in [Google.NTx86] or in [Google.NTamd64] scope:
; Google Nexus 5
%CompositeAdbInterface% = USB_Install, <first hardware id value>
%CompositeAdbInterface% = USB_Install, <second hardware id value>
Now, uninstall the old driver and unplug the phone. Make sure you have USB debugging turned ON. Plug the phone again. Choose a driver like in Solution #3.
After this step I have finally noticed LGE Nexus 5 entry in Devices tab (and hopefully you did too ;)). You can also check it in adb (go to adb.exe location (mine is – C:Program Files (x86)Androidandroid-studiosdkplatform-toolsadb.exe) and type
adb devices. Nexus 5 should be on the list.
Now, enjoy writing and debugging your applications 😉