Android | Ranorex
Help CenterUser GuideInterfaces and connectivity

Android apps

In this chapter, you’ll learn how to instrument an Android app.

tipp icon

Attention

For Android developers: As part of the instrumentation process, the app will be compiled with the Ranorex automation library. This library adds additional functions and permissions to your APK. This is why we recommend you do NOT publish instrumented apps to Google Play.

In this chapter

    Preparations

    Before you can instrument and deploy an app for automation with Ranorex, complete the following preparations:

    Prepare the app

    Make sure you can access the APK from the computer on which Ranorex Studio is installed. We recommend that you store a copy of the APK in a folder on that computer.

    Prepare the mobile device

    • Apply the ⇢ device settings.
    • ⇢ Connect your device to the computer on which Ranorex Studio is installed.
    • Start the Ranorex Service App on the device.
    Note icon

    Note

    You can instrument and then immediately deploy the app to your mobile device with the Instrumentation Wizard. If you want to do so, you must connect the mobile device to your computer via USB (recommended).

    Instrumentation example

    For our example, we’ll instrument the Dropbox app. The app is a product of Dropbox, Inc, whose terms and conditions for downloading and using the app apply. 

    In preparation for instrumentation, we’ve stored the app in the folder Android app testing on the computer Ranorex Studio is installed on.

    Select technology

    Start the Instrumentation Wizard and confirm the Windows security dialog.

    Click Android.

    Click Next.

    Specify APK and settings

    Click Browse…

    Browse to the folder that contains the APK.

    The APK appears in the Instrumentation Wizard.

    Click Settings… if you want to apply special settings.

    Default settings for instrumenting the app.

    Default settings for deploying the app after instrumentation.

    Select mobile device

    Finally:

    Select a mobile device from the list of available devices or
    Open the endpoint list to select a mobile device.

    Start instrumentation and deployment

    Click Next > to start the instrumentation process.

    Watch it progress. It can take several minutes.

    The app has been instrumented successfully.
    Note icon

    Note

    If the process fails, please first check you’ve applied the ⇢ device settings correctly and ⇢ connected the device properly. A common problem is also that another program is consuming too many resources, slowing down instrumentation to the point of a timeout error. Either close all other programs or increase the Instrumentation timeout in the settings.

    Result

    If the app has been instrumented and deployed correctly, you will see the following on your device:

    The instrumented app appears in the Ranorex Service App.

    The instrumented app appears on your device’s homescreen.

    In Ranorex Studio, you can see the app has been instrumented correctly if it appears for selection when creating a mobile test.