Run offline instrumentation on Android apps

To run offline instrumentation on Android apps, perform the following steps.

Step 1 | Install the tool

Perform the following steps to install the offline instrumentation tool. Repeat these steps whenever a new version of the tool becomes available.

  1. Contact Perfecto Support to request the offline instrumentation tool. The Perfecto Support team will send you the offline instrumentation installation package (a file called offlineInstrumentation-offlineBundle-<version>.zip).

  2. Extract the offline instrumentation installation package to a folder of your choice.

  3. On Linux/macOS, to verify and set the proper permissions before executing the script, open a command-line window and run the following command from the folder to which you extracted the package.

    Copy
    Linux/macOS 
    chmod +x install_offline_instrumentation.sh
  4. In a command-line window, from the folder to which you extracted the package, execute the install script depending on your platform.

    Copy
    Windows
    install_offline_instrumentation.bat
    Copy
    Linux/macOS 
    bash install_offline_instrumentation.sh
  5. When prompted for the installation location, provide the path to the installation folder. Make sure the installation path does not contain spaces or special characters.

    Important: If the selected installation folder is not empty, the installation will override any files from a previous installation without any notification.

    The script creates an OfflineInstallation folder inside the installation location you specified in step 5 and extracts files to this folder. When the installation is complete, the script deletes the .zip files and scripts that you extracted from the package you received from Perfecto Support.

Step 2 | Perform offline instrumentation

Repeat the following steps for each app you want to instrument.

During the instrumentation process, you will see real-time progress updates. Upon completion, the fully instrumented .aab or .apk file is generated.

  • From the command-line window, run the following command with the relevant parameters.

    To learn more about the available parameters, see Parameters for Android offline instrumentation.

    Copy

    Example 1 with parameters

    java -jar "<path_to_file>/offline-instrumentation.jar"

                                        -f "/<path_to_file>/SecureScreen_demo.apk"

                                        -o "/<path_to_output_folder>"

                                        -pmlib "/<path_to_file>/pmlib.zip"

                                        -androidsdk "/Users/{user}/Library/Android/sdk"

                                        -below5 false

                                        -camera false

                                        -finger false

                                        -spy false

                                        -activity false

                                    -securedscreen true

    Copy

    Example 2 with parameters

    java -jar "/<path_to_file>/offline-instrumentation.jar"

                                        -f "/<path_to_file>/SecureScreen_demo.apk"

                                        -o "/<path_to_output_folder>"

                                        -pmlib "/<path_to_file>/pmlib.zip"

                                    -securedscreen true

Step 3 | Upload the app to Perfecto

How you upload the instrumented application to Perfecto depends on whether you are a manual tester or an automation tester.

Make sure not to instrument the app again during the app installation process.

What's next?

When the app is instrumented, installed, and running on the device, you can inject sensory input. To learn more, see: