Hello, by the title of the post, you already have an idea about this article’s content that “How you can test Android App without any Emulator,” so here it is. This post surely helps those developers who have a low configuration system and gets frustrated with the hang and slow down of the course while testing the android application.

Also Read About: How to Start Career in Android Development in 2020

How to Test Android App:

In this article, I will share “3ways” to test your android application on your real android devices instead of Virtual Devices.

1st Way: By Building .apk file

Build a .apk file of your project, get that file into your smartphone, and install it. It’s one of the best ways to test android applications on the real device. But the main drawback with this Way is if there any crashes or errors, you will not get logs of that error in logcat. Below is the process of building a .apk file.

In Android Studio, click on “Build” on the top bar. > Then click on “Build Bundle(s) / APK(s)” > Then select “Build APK(s)”. After that, automatically, the “Gradle Build Running” get started. After Gradle Build gets finished in the bottom right corner, there will be one pop-up “APK(s) generated successfully.” In that pop-up, click on locate and new window gets open in that windows, there is a file by name
app-debug.” get that file into your and phone and install it.

Process of Building .apk file.

2nd Way: By running the app directly on the device

It’s an easy and fast way of testing android application into a real android device. For this, connect your phone with your system using the USB cable. And On the USB debugging and Install via USB mode on your android device in “Developer Options” in settings. If you cannot find Developer Options on your device, click 5-time on “Build Version” or “Android Version” on your device, and Developer Option gets enable. Allow all the permissions. After that, you will find your device name show in the Android Studio, click on “Run,” after that gradel build gets to start, wait for several minutes to get the app installed on your device. If your app has some crashes, it will show in the logcat.

You can also use: Genymotion as AVD! Download Genymotion from Here

3rd Way of Test Android App: Run the app Wirelessly

The Way now, I am going to tell you which I preferred most because this is a much faster and hazel free way to test android application on a real device as compare to the above methods.

Using this Way, you can test the android app without connecting your phone with your system using USB.

  1. First, Turn on ADB in your phone’s developer options. You can search for Your_phone_model developer options to find that.
  2. Second, After turning on ADB, Connect your phone with a data cable to your laptop/desktop.
  3. Open a Command Prompt window, type adb tcpip 5555, Press allow in adb prompt shown in your phone, and restarting adb in tcpip mode. Now, disconnect the USB cable. You can use a different port number to connect another device.
  4. Type adb connect your_phone_ip:5555, for example, adb connect 192.168.43.1:5555 in a hotspot. You can check the Phone’s IP in the advanced WiFi setting of your phone or status section.
  5. Now, every time your device restarts, repeat steps 3-4.

We can also make a script; type adb connect your_phone_ip:5555 in a notepad file, save it as name.bat file, right-click on it and send it to desktop (create shortcut), in the settings on the alternative, set any shortcut keys. Now, anytime you want to connect, press the shortcut keys. That’s how I do it. You can further open the Android studio by this script.
Remember, whenever it says Device is Offline, restart your phone’s WiFi and reconnect it.

Thank You!

LEAVE A REPLY

Please enter your comment!
Please enter your name here