Debug – Native Android App

>>>Debug – Native Android App
Debug – Native Android App 2018-03-16T16:05:24+00:00

Perfecto DevTunnel provides the ability to debug Android mobile apps on real devices under realistic conditions. This speeds the process of validating new features and fixing bugs that only show up under specific environments or conditions.

Watch the video above, or follow the step-by-step below…



1. Install Android Studio

2. Install Perfecto plugin for Android Studio

3. Download sample app (.apk) –

Download the app as .zip file and extract it.



Debug on a Mobile Device

1. Open the android-calculator-master app project.

2. Click the ‘Launch Mobile’ icon in the Perfecto Android Studio plugin toolbar.

3. Select an Android device and click “open”


4. Switch to the Widgets menu and click the ‘DevTunnel’ widget.


5. If you have not done so already, download and install the DevTunnel installer. Wait for the installation to complete.


6. Click the ‘Start Dev Tunnel Session’ step to establish a direct connection to the device.

7. Open the application code file, here it is in the file


8. Set the breakpoints in the code where you suspect that there are problems.




9. While Android Studio is focused on the app code, click on the Debug icon.

10. Select the Android device you opened from the Perfecto cloud plugin that appears in the Select Deployment Target window and click ‘OK’ to launch the application in debug mode on the device.


11. After Gradle build is successful, note that Android Studio utilizes ADB commands against the device to copy .apk resources to the device, and launch the app in debug mode.


12. Interactively, exercise the application and activate the suspicious interface elements. In this case, it is the input field of the “Split Number”. Enter a number, then delete it, and the application crashes with an Exception.



13. When we enter ‘3’ into the field – the debugger stops at the breakpoint, stepping through the method shows that it works fine.



14. Now, we delete the ‘3’ in the field. The debugger again stops at the breakpoint. And we examine the variable values.

15. Performing a “step over (F8)” command causes the application to crash. So, we know that we need to analyze and understand what is causing the crash.

16. The problem seems to be with the call to “Integer.parseInt(s.toString())” when the string is an empty string (as noted above). So, we change the code to check for this occurrence:

17. Rerun the app with the debugger and note that it works as planned even when the “input” is empty.

18. When finished, click the ‘Disconnect’ button from the Perfecto Widgets frame to close your DevTunnel session.


19. Click the ‘X’ on the device window to release the mobile device.


Congratulations! You now know how to connect a real, cloud-based mobile device from the Perfecto Lab into your IDE. Try it out with the next feature you’re building or run some of your own tests on different devices to see if your apps pass with flying colors on other platforms.