Connect Android device to Android Studio

This tutorial explains how to connect your Android device to Android Studio with step by step instructions.

Explanation

Creating apps in Android Studio is very easy. What about running and testing? Android Studio provides us a way we can run over apps on our handset Android devices very easily and quickly. If you don’t have an Android device, don’t worry, Android Studio has an emulator for you, it creates virtual Android device, so you can run and text your apps without actually having an Android smartphone. This time I will show you how to connect Android device to Android Studio. As there is no substitute for running your apps on hardware devices.

Pre requisite

Following are some pre requisite for this:




Step 1) Enable USB debugging

The very first step is to enable USB debugging on your Android device. To do this follow these steps

  • On your phone (or tablet) go to Settings=> About Phone
  • Tap Build Number 7 times, after 7th time it will say You are now a developer.
Step 1: USB debugging

Step 1: USB debugging

  • You will notice Developer’s Options are now available.
Step 2: USB debugging

Step 2: USB debugging

  • Go to the Developer option and enable USB debugging
Step 3: USB debugging

Step 3: USB debugging

Click OK.

Step 4: USB debugging

Step 4: USB debugging

Step 2: Install USB driver

Next step is to install USB driver for your Android device. For this follow instructions from your device manufacturer. For example, I am using Android smartphone of Huawei, so I just downloaded Huawei USB driver from their official website. If your device uses Google USB driver you can download from this link http://developer.android.com/sdk/win-usb.html. After installation you need to update it. Make sure your device is connected through a USB cable. Go to the Control Panel => Device Manager then locate and right click your Android device and click Update driver software.

Note: Make sure your Android device is not sleeping while connected through USB cable.

Step 3: Run your app

No you can run your Android app. Right click on the app and click Run. Or simply select run option from the tool bar menu shown below.

Android Studio screen

Android Studio screen

A window Select Deployment Target will appear, and a list of available devices will appear. Choose your device and click OK. Android Studio will run your application in your Android device.

Deployment target

Deployment target

Click on Use same selection for future launches if you want to save this setting for later apps.

References

Official Android OEM driver installation guidelines

Samsung Android USB driver for Windows

LG Android USB drivers

4.6 13 votes
Article Rating
guest
3 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Bella
Bella
3 years ago

Very useful, thank you so much. 🙂

Lucas
Lucas
1 year ago

tks

Ken
Ken
1 year ago

When trying to run on android I’m running into a numberformatexception with the value “google_app_id”. Anyone know what needs to be set?