Parameters for Android offline instrumentation

Learn more about the parameters you can use when instrumenting Android apps offline, including required parameters, instrumentation flags, signing parameters, logging, help and version.

Required parameters

The following table lists the required input and output parameters.

Parameter Description

-f <path>

The path to the input .apk, .apks, or .aab file.

-o <path>

The path to the output folder for the instrumented app. The folder is created if it does not exist, and it must not be the folder that contains the input file.

Caution: Use a different folder from the one containing the input app. If you use the same folder, the tool replaces the original app. Running the tool again on that file can double-instrument and corrupt it.

An .aab input is converted to a split-APK set and produces an .apks output, not an .aab. An .apk or .apks input retains its file type on output.

Instrumentation parameters

At least one of the following instrumentation parameters must be explicitly supplied for an instrumentation run. Omitting all four causes the tool to exit with Missing required argument(s).

Each parameter takes an explicit true or false value, for example -camera true. All four default to false and are independent: enabling one does not enable another. Set every instrumentation type you want to apply to true. You can combine multiple types in a single run.

Parameter Description

-spy true|false

A value of true enables object instrumentation, also called hybrid instrumentation.

-camera true|false

A value of true enables camera instrumentation for camera injection.

-finger true|false

A value of true enables fingerprint instrumentation for fingerprint injection.

-securedscreen true|false

A value of true removes the app's secure-screen flag so that the screen can be captured or recorded during testing.

Parameters for signing your app with your organization's certificate

Custom signing is optional. If you do not supply any of the following parameters, the tool signs the output with Perfecto's bundled certificate, PerfectoKey.jks.

To use your own keystore, supply all four parameters together. Supplying only some of them causes an error.

Parameter Description

-keypath <path>

The full path to the keystore file.

-keystorepass <password>

The password for the keystore file.

-keyalias <alias>

The identifying name for your key.

-keypassword <password>

The password for the key.

Optional parameters

The following table lists the logging, help, and version parameters.

Parameter Description

-loglevel <LEVEL>

The logging level: INFO, DEBUG, WARN, or ERROR. The default is INFO.

-h, --help

Print usage help and exit.

-V, --version

Print version information and exit.