How to Enable USB-Debugging with Nexus 5 for Android Studio
Join the DZone community and get the full member experience.Join For Free
one of the required tools that you will need when building android apps is the ability to debug on a local device. while plugging in the device via usb gives you access to the files stored on the device, it does not enable your app to be deployed on it. let’s see what is required to deploy and test your android app on a local device. in this case, we will be working with the nexus 5.
starting with the sdk manager
you will need to begin by going to the sdk manager. since we have been using android studio so far , it is just as easy to navigate to it through the ide by going to tools->android->sdk manager.
this will open the following dialog prompt and from here you will need to scroll down to the very bottom and look for “ google usb driver ” as shown below.
note: if you are not using a “google” based phone, you can get the required drivers usually through the manufactures site. (ex. samsung)
make sure you place a checkmark in “ google usb driver ” and hit the install packages button.
installing the drivers
from the screenshot, you can tell that it places the files in the “ c:\program files (x86)\android\android-studio\sdk\extras\google\usb_driver ” folder. but that is all that it does, it does not install them.
if you navigate to that folder, you will need to right click on the android_winusb.inf file and install the drivers.
hit “ install ” on this prompt and you are done for the windows side.
getting your device set up
after the drivers are successfully installed on your pc, you will need to enable the “ developer mode ” on your nexus 5. since you are running kitkat, you can do this by going to settings -> about phone -> build number (tap the build number 7 times.)
if done successfully, you will now see the “ developer options ” at the bottom of the settings menu.
tap on “ developer options ” and place a checkmark in “ stay awake ” and “ usb debugging ”.
now connect your device to your usb port on your computer and you should get the following screen:
place a checkmark in the “ always allow from this computer ” and hit “ ok ”. you are now free to open android studio and run your app on your local device!
thanks for reading and if you are interested in learning how to setup your android studio development environment, then just click here .
Published at DZone with permission of Michael Crump. See the original article here.
Opinions expressed by DZone contributors are their own.