Run offline instrumentation on Android apps
To run offline instrumentation on Android apps, perform the following steps.
On this page:
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.
-
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
). -
Extract the offline instrumentation installation package to a folder of your choice.
-
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.
-
In a command-line window, from the folder to which you extracted the package, execute the install script depending on your platform.
-
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.
CopyExample 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 trueCopyExample 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.
-
Manual tester: Install and start the app through the Perfecto UI.
To learn more, see Application management.
-
Automation tester: Upload the app to the Perfecto repository, and then install and start the app on the device using Appium drivers.
To learn more, see Application installation and startup with Appium and Application installation and startup with Appium.
What's next?
When the app is instrumented, installed, and running on the device, you can inject sensory input. To learn more, see:
-
Inject biometric data (manual testing)
-
Injection of sensory input (automation testing)