Script-based instrumentation for Android apps

Perfecto offers script instrumentation (may also be referred to as remote instrumentation) to help you prepare Android apps for testing without needing access to the Mobile Cloud Manager (MCM).

This method lets you instrument and optionally sign an Android Package (APK) or Android App Bundle (AAB) by uploading it to Amazon AWS S3. The result is an instrumented file ready to install and test on a Perfecto device.

Additionally, the script supports signing the instrumented app with a certificate that you supply. This allows automation testing of the app in a form that better resembles the app that will be used by the end user.

Why use script instrumentation?

  • Allows custom signing with your own certificate, ensuring the test version closely mirrors the production app.

  • Offers a consistent instrumentation process, whether or not you re-sign the app.

  • Allows separation of the app preparation for testing from the actual tests and installations (rephrase)

What the script does

The script performs the following steps:

  1. Uploads the APK or AAB file to the AWS cloud.

  2. Instruments and (optionally) signs the app.

  3. Stores the resulting file in AWS S3.

  4. Saves the instrumented application file in the specified folder.

Supported environments

Script instrumentation of Android apps supports the following environments:

  • Windows
  • Mac OS
  • Linux OS

Prerequisites

Before installing the script, verify that the workstation that will run the instrumentation with a customer certificate has Python 3 with request module installed, as follows. Python 2.x is not supported.

To install the request module, run the following command:

Copy

Window 10 or later

python -m pip install requests
Copy

macOS or Linux

python -m pip install requests

Limitations

You cannot use multiple certificates to sign the application.

What's next?

Run script-based instrumentation on Android apps