Android Test App on Real Device (Mobile / Phone)

To test or run an android app on real devices such as mobile or phone is faster than AVD. We have different approaches available to run an android app on the real device, those are

 

  • Enable USB Debugging on Device
  • Build APK and Install on Device 

If we enable USB Debugging and connect the device to the system, automatically our device will be shown online in the android emulator device list to run our app on the real device.

 

Instead of enabling USB Debugging, we can directly Build APK for our app in android studio and by installing that APK on our mobile / phone, we can run and test our app.

 

Now we will see step by step process to enable USB Debugging on Device and Building an APK for an App using the android studio to run and test the app on a real device with examples.

Enable USB Debugging on Device

Now open the Settings section in the device which you want to run the android app like as shown below.

 

Open the Settings Section on Android Mobile Phone

 

In case Developer options not enabled in your phone, search for “About Phone or About Device” option and click on it like as shown below.

 

Android Select About Phone Option to Enable Developer Options

 

After that search for the Build number option and tap on it 7 times to enable Developer options like as shown below.

 

Android Tap on Build Number to Enable Developer Options

 

Now go back and click on Developer Options to enable USB Debugging option like as shown below.

 

Android Enable USB Debugging Option in Settings

 

Once you enable the USB Debugging option, it will show the notification message as shown below and click OK to enable USB Debugging.

 

Android Notification to Enable USB Debugging on Mobile Device

 

Now connect your device to the system via data cable and select allow USB Debugging option. After that select Run App option in android studio to run your app from emulator like as shown below.

 

Run app in android studio using Run App Option

 

In case your device connected to the system and if it in online, that will be shown in the emulator window to run the app in a real device like as shown below.

 

Devices to Run the App in Android Emulator

 

This is how we can enable USB debugging on real device to test or run an android application based on our requirements.

Build APK and Install on Real Device

In case if you are not interested to do USB debugging, then we can build an app APK using android studio and install it on a real device to test or run our application functionality.

 

Open your app in android studio, Go to Build option in menu bar and select Build APK option like as shown below.

 

Build APK for App in Android Studio

 

After click on Build APK option, our android studio will generate an APK for our application and it will show the APK generated path like as shown below.

 

After Generating Build APK for Android App in Android Studio

 

Now click on Show in Explorer option, it will navigate you to the APK generated path like as shown below.

 

Android Generated Build APK file in Folder Path

 

Now you can send this APK file to your GMAIL and open that email, install your APK on the device which you want to run the app.

 

To install third-party APK’s you need to enable unknown app installation permissions in your device. While installing your APK, the device will ask for the permission to install an app on your device.

 

Once you allow the permission to install APK, your app will be installed in your device to perform your operations like as shown below.

 

Android Test App on Real Device Example Result

 

This is how we can run/test our android apps on real devices such as mobile / phone, etc. based on our requirements.