When building an Android app, it's important that you always test your application on a real device in addition to emulators. This page describes how to set up your development environment and Android-powered device for testing and debugging on the device.
If you want an ideal SIM-unlocked phone to test on, then you might consider a Pixel phone.
Plug in your device to your computer with a USB cable. If you're developing on Windows, you might need to install this universal ADB USB driver or find your specific USB driver for your device.
The next step is to enable USB debugging so your phone can interact with your computer in a developer mode.
The following steps are needed:
Watch this video tutorial for a visual guide to getting USB debugging enabled.
Now, we can launch apps from Android Studio onto our device:
Once Gradle finishes building, Android Studio should install the app on your connected device and start it.
Not seeing your device in the "Choose Device" window? Try the following:
Settings => Developer options => USB Debugging
is enabledNow the phone should work as a debugging device as expected!
Still Not Working?
If after plugging the device into the computer and you don't see any message about authorizing the device, then you may need to purchase another USB cable. Not all USB cables are enabled for data transfer. If there's a chance that your cable may be a charging only cable, you can purchase a USB-C cable for Pixel or the micro-USB cable for Nexus 6 and prior.