Clean application (FR)

Perfecto Command

mobile:application:clean

Purpose

Cleans the data (including cache) from any application installed on the device and brings the application back to its initial state. This saves time and instantly resets the app for the next test.

To use this command, the application identifier is required. For information on retrieving the application identifier, see Application identifier.

Limitation

This command is not supported for iOS devices.

Parameters

Name Type Possible Values Description
name String
The application name as it is displayed on the device screen.
identifier String
The identifier of the application.

Return Value

String - "OK" or "Failed"

Exceptions

None

Examples

Copy

Java example

//declare the Map for script parameters
Map<String, Object> params = new HashMap<>();
  
params.put("identifier", "com.google.android.apps.maps");
driver.executeScript("mobile:application:clean", params);
Copy

C# example

//declare the Map for script parameters
Dictionary<String, Object> pars = new Dictionary<String, Object>();
  
pars.Add("identifier", "com.google.android.apps.maps");
driver.ExecuteScript("mobile:application:clean", pars);