Run Or Debug Android App Using Real Device With Example

In this post, we will learn on how to run or debug android app using real android device. We will see how to use USB to connect device with laptop and run android app(in Android Studio IDE) in phone.

Getting Started

As a developer, if you are developing an android app for a phone, you should test it on real device. Of course, you can use emulator. But, that does not provide 100% correct experience.

So, we need to learn how use real android device with android studio IDE to run any android application.

Enabling Developer Options in Phone

To be able to run android app from android studio IDE, we need to enable developer option in phone.

Allowing Developer options enable developer to use phone for development purposes.

So, we will enable it now.

Enabling Developer Options in real device may differ based on different mobile. But, most of the steps will be similar. Here, we are using MI 10i phone. So, steps given below will be accordingly.

Follow steps below to do enable Developer Options in device –

  • Go to Settings. Below screen will be shown
    Tutorialwing Android Developer Options ON Debug Android App on phone Example

    Enable Developer Mode – Step 1

  • Now, Click on About Phone. It will navigate to below screen.
    Tutorialwing Android Developer Options Enables Run or Debug on Real Device Example

    Step 2

  • Now, click on MIUI Version 7 times quickly to enable Developer Options.
    Tutorialwing Android Deverloper Options Enable Debug or Run Android Application in real device
  • Now, go to Settings => Additional Settings. We can see a Developer Options there.
    Tutorialwing Android Developer Options enable Install Android App real device android studio
  • Inside Developer Options, we see ui like below –
    Tutorialwing Android Enable Developer Options debug in phone Example

Enabling Developer Options is not enough. We need to enable USB Debugging options to be able to connect device with laptop.

Enable USB Debugging

We have successfully enabled Developer Options. Now, we need to enable USB debugging so that device can be attached with android studio IDE.

Follow steps below to do it –

  • Go to Settings =>Additional Settings => Developer Options
  • Find USB Debugging option. Currently, it’s disabled. Click on it.
    Tutorialwing Android Android App on phone enable USB Debugging option
  • Clicking on USB Debugging opens popup to ask for confirmation message. Click OK if it’s ok for you.
    Tutorialwing Enable Debug Option USB Debugging
  • Finally, we will see USB Debugging option enabled as shown below –
    Tutorialwing Android Run Android App using phone Example

Enable Developer option and USB Debugging (Video Sample)

If there is any issue while going through process, you can see sample video here –

Connect Device to Computer

Till now, we have enabled Developer Options and USB Debugging. Now, we need to connect phone again using USB cable. It should be detected in Android Studio now.

Run Android App using Real Device

We have already created a HelloWorld App in Android Studio. Now, we will run that application using provided run icon. Click on it. Finally, HelloWorld App should look like below –

Tutorialwing Android Run or Debug Android App Sample Example

Run App on Real Device

Debug Android App using Real Device

Now, we can add a break point where-ever we want to debug. Then, start debugging app.

Thus, have seen how to run or debug android app in real device.