Install application (FR)

Perfecto Command

mobile:application:install

Purpose

Installs a single application on the device, using automation. To use this command, the application must first be uploaded to the Perfecto repository. The PerfectoLabUtils class provides the uploadMedia method to upload a file to the Repository.

The Install application function performs the same operation as the Install widget in the Manual testing view (see Manage apps).

For Android devices

  • The application manifest.xml file must include internet access permission: <uses-permission android:name="android.permission.INTERNET"/>
  • The application will automatically be signed with an Android debug key to enable native object automation.

Parameters

Name Type Possible Values Description

certificate.file

Multimedia


The repository path, including directory and file name, of the certificate for certifying the application after instrumentation. This is the Keystore file in Android devices.

Example - PRIVATE:dir1/dir2/name.jks

certificate.user

String

050854

The user for certifying the application after instrumentation. This is the Key Alias in Android devices.

The user can be encoded using the String Encoder.

certificate.params

String


The key password parameter for certifying the application after instrumentation. This is the Key Password in Android devices.
The value must be preceded with "keypass".

The param can be encoded using the String Encoder.
Example - keypass 3f51s6

certificate.password

String

The password for certifying the application after instrumentation. This is the Keystore Password in Android devices.

The password can be encoded using the String Encoder.

dataReset

Boolean

true | false

Indicates if the application data on the device should be cleaned prior to installation.

True (default): All application data is cleaned and the application starts with a clean slate

False: Existing application data is kept on the device. The application will be able to access the existing data.

file (Mandatory)

Multimedia


The full repository path, including directory and file name, where to locate the application.

Example - PRIVATE:dir1/dir2/name.apk

instrument

String

noinstrument | instrument

Performs instrumentation.

instrument - perform Object tree instrumentation

noinstrument (default) - no instrumentation performed, use visual analysis to identify DOM objects.

resign

Boolean

true | false

(iOS only) Re-signs the app with a Perfecto code-signing certificate that has the cloud device provisioned. To learn more, see Re-sign an application | iOS.

securedScreenInstrument

String

secured_screen_removal | no_secured_screen_removal

When set to secured_screen_removal, turns on instrumentation of secured screens on devices running Android 12 and later. In this case, calls on the app that use FLAG_SECURE will be removed (only setFlags() and addFlags() methods that use FLAG_SECURE are affected), and secured screens will be visible in the installed app.

sensorInstrument

String

nosensor | sensor

Enables data input via device sensors (for example, camera or fingerprint) for the application.

sensor- sensor reads data from the appropriate injection command
nosensor (default) - sensors are not primed for program input.

Restriction: The certificate.x parameters are relevant for Android devices only and used only if the instrumentation parameter is set to instrument.

Return Value

None

Exceptions

None

Examples

Copy

Java example

//declare the Map for script parameters
Map<String, Object> params = new HashMap<>();
 
params.put("file", "PRIVATE:applications/Errands.ipa");
params.put("instrument", "noinstrument");
driver.executeScript("mobile:application:install", params)
Copy

C# sample

//declare the Map for script parameters
Dictionary<String, Object> pars = new Dictionary<String, Object>();
 
pars.Add("file", "PRIVATE:applications/Errands.ipa");
pars.Add("instrument", "noinstrument");
driver.ExecuteScript("mobile:application:install", pars);