To test an android apps in a real device with Android Studio, You must keep two things in mind
- You should enable USB debugging option on your android phone.
- You must have driver installed on your computer.
Now , let me tell you how you can enable USB debugging on your android phone:
- Go to Settings on your android phone
- Scroll down to the bottom and click on About phone
- On this menu also scroll down to the bottom, you should see something Build number
- Click on Build number 7 times
- Now your Developer Option enables, once you done click on back button and you should see a new option on your android screen i.e. Developer Options
- Click On Developer Options
- Scroll down until you see USB Debugging
- Go ahead and click the check box next to the USB debugging
- Now your USB Debugging option enables.
- Connect your android device to your computer with the help of USB connector.
Now let me tell you how you can download the driver on your Windows PC:
- Your windows machine need a software called driver to communicate with your phone.
- Go To OEM USB Driver Website to install your appropriate driver
- Scroll down and select the driver appropriate for your device.
Check the screen shoot
- Once you download it , you have to unzip your file
- After Installing Google USB Driver, close SDK Manager window, Connect your phone or tablet through USB cable to your laptop or PC.
- Now click on My Computer (Windows 7) (or) This PC(Windows 8.1).Select Manage.
- Select Device Manager –> Portable Devices –> Your Device Name
- Right Click on Your Device Name and Select Browse My Computer For Driver Software.
- Point it to C:\Users\YourUserName\AppData\Local\Android\sdk\extras\google\usb_driver. Hit Next and Finish.
- Now Hit Run Button after selecting Your Project in Project Explorer in Android studio. Choose your device and press OK.