# Pcloudy Mobile Commands (Advanced Appium Actions)

Last updated on : 09 Jan 2026

Overview
Pcloudy provides a set of custom mobile commands that can be executed within Appium scripts to control device behavior, simulate real-world scenarios, and enhance automation coverage.

These commands are executed using:

```java title="Java"
driver.executeScript(...)
```

They work across Android and iOS, depending on the feature.

## When to Use Pcloudy Mobile Commands

Use these commands when you need to:

* Control device settings (Wi-Fi, GPS, rotation)
* Simulate biometrics (Fingerprint / Face ID)
* Perform network simulation
* Capture videos and logs
* Execute ADB commands
* Perform OCR and visual validation
* Retrieve execution reports programmatically

## Command Categories

* Device Control
* Network & Location
* Media & Reporting
* Biometric Authentication
* OCR & Visual Testing
* Application Management
* User Actions

### 1. Execute ADB Commands on a Booked Device

Command

```java title="Java"
driver.executeScript("Pcloudy_executeAdbCommand", "ADB_COMMAND");
```

Example

```java title="Java"
Object obj = driver.executeScript("Pcloudy_executeAdbCommand", "adb devices"); System.out.println("@Output: " + obj);
```

### 2. Set Android Device Location

Command

```java title="Java"
Map<String, Object> params = new HashMap<>();
params.put("latitude", "28.6139");
params.put("longitude", "77.2088");
driver.executeScript("Pcloudy_setAndroidLocation", params);
```

Example

```java title="Java"
System.out.println(driver.executeScript("Pcloudy_setAndroidLocation", params));
```

### 3. Toggle Device Location (Android / iOS)

Command

```java title="Java"
driver.executeScript("Pcloudy_switchDeviceLocation", "true/false");
```

Example

```java title="Java"
driver.executeScript("Pcloudy_switchDeviceLocation", "true");
```

### 4. Enable or Disable Wi-Fi on Android

Command

```java title="Java"
driver.executeScript("Pcloudy_enablewifi", "true/false");
```

Example

```java title="Java"
driver.executeScript("Pcloudy_enablewifi", "true");
```

### 5. Android/iOS - To get a video for every test case during Appium session.

Command

```java title="Java"
Map<String, Object> params = new HashMap<>(); params.put("enableRecord", true); System.out.println(driver.executeScript("mobile:video:record",params));
```

Example

```java title="Java"
Map<String, Object> params = new HashMap<>(); params.put("enableRecord", true); System.out.println(driver.executeScript("mobile:video:record",params));
```

### 6. Android/iOS - To stop a video generation during Appium session.

Command

```java title="Java"
Map<String, Object> params = new HashMap<>(); params.put("enableRecord", false); System.out.println(driver.executeScript("mobile:video:record",params));
```

Example

```java title="Java"
Map<String, Object> params = new HashMap<>(); params.put("enableRecord", false); System.out.println(driver.executeScript("mobile:video:record",params));
```

### 7. Android/iOS - To get a report link.

Command

```java title="Java"
driver.executeScript("Pcloudy_getReportLink");
```

Example

```java title="Java"
String link = (String) driver.executeScript("Pcloudy_getReportLink"); System.out.println(link);
```

### 8. Android - Biometric automation on Android devices.

Command

```java title="Java"
Map<String, Object> params = new HashMap<>(); params.put("auth", true); System.out.println(driver.executeScript("mobile:fingerprint:auth",params));
```

Example

```java title="Java"
Map<String, Object> params = new HashMap<>(); params.put("auth", true); System.out.println(driver.executeScript("mobile:fingerprint:auth",params));
```

### 9. iOS - Biometric automation on iOS devices.

Command

```java title="Java"
Map<String, Object> params = new HashMap<>(); params.put("auth", true); System.out.println(driver.executeScript("mobile:biometric:auth",params));
```

Example

```java title="Java"
Map<String, Object> params = new HashMap<>(); params.put("auth", true); System.out.println(driver.executeScript("mobile:biometric:auth",params));
```

### 10. Android/iOS - To inject QR code image.

Command

```java title="Java"
"Map<String, Object> params = new HashMap<>();
params.put(""image"", ""QR_code_G.png"");
Thread.sleep(2000);
System.out.println(diver.executeScript(""Pcloudy_injectImage"",params));
Thread.sleep(2000);"
```

Example

```java title="Java"
"Map<String, Object> params = new HashMap<>();

params.put(""image"", ""QR_code_G.png"");
Thread.sleep(2000);
System.out.println(driver.executeScript(""Pcloudy_injectImage"",params));
Thread.sleep(2000);"
```

### 11. Android/iOS - To start network simulation.

> **Note:** User can get information about all the network profiles available according to that user can simulate the network.

Command

```java title="Java"
Map<String, Object> params = new HashMap<>(); 
params.put("profileName", "4G-LTE-Advanced"); 
System.out.println(driver.executeScript("mobile:network:start",params));
```

Example

```java title="Java"
Map<String, Object> params = new HashMap<>(); 
params.put("profileName", "4G-LTE-Advanced"); 
System.out.println(driver.executeScript("mobile:network:start",params));
```

### 12. Android/iOS - To reset network profiles.

Command

```java title="Java"
Map<String, Object> params = new HashMap<>(); 
params.put("profileName", "4G-LTE-Advanced"); 
System.out.println(driver.executeScript("mobile:network:stop",params));
```

Example

```java title="Java"
Map<String, Object> params = new HashMap<>(); 
params.put("profileName", "4G-LTE-Advanced"); 
System.out.println(driver.executeScript("mobile:network:stop",params));
```

### 13. Android/iOS - To get all the text present in an image.

Command

```java title="Java"
Map<String, Object> params = new HashMap<>(); 
driver.executeScript("mobile:ocr:text",params);
```

### 14. Android/iOS - To compare and find the difference between two images.

Command

```java title="Java"
Map<String, Object> params = new HashMap<>(); 
params.put("baseImageId", "firstImageId"); 
params.put("secondImageId", "secondImageId"); 
driver.executeScript("mobile:visual:imageDiff",params);
```

### 15. Android/iOS - To verify if any word exists or not in an image.

Command

```java title="Java"
Map<String, Object> params = new HashMap<>(); 
params.put("imageId", "ID"); 
params.put("word", "abc"); 
System.out.println(driver.executeScript("mobile:ocr:textExists",params));
```

### 16. Android/iOS - To find the coordinates of a word.

Command

```java title="Java"
Map<String, Object> params = new HashMap<>(); 
params.put("imageId", "ID"); 
params.put("word", "abc"); 
System.out.println(driver.executeScript("mobile:ocr:coordinate",params));
```

### 17. Android/iOS - To start the transaction execution with HAR file.

Command

```java title="Java"
Map<String, Object> params = new HashMap<>(); 
params.put("transactionName", "Name of transaction file"); 
params.put("enableHar", true); 
params.put("harFileName", "Har file Name"); 
driver.executeScript("mobile:transaction:start",params);
```

### 18. Android/iOS - To stop the transaction execution.

Command

```java title="Java"
Map<String, Object> params = new HashMap<>(); 
driver.executeScript("mobile:transaction:stop",params);
```

### 19. Android/iOS - To rotate the device in landscape mode.

Command

```java title="Java"
Map<String, Object> params = new HashMap<>(); 
params.put("orientation", "L"); 
System.out.println(driver.executeScript("mobile:device:rotate",params));
```

### 20. Android/iOS - To rotate the device in portrait mode.

Command

```java title="Java"
Map<String, Object> params1 = new HashMap<>(); 
params1.put("orientation", "P"); 
System.out.println(driver.executeScript("mobile:device:rotate",params1));
```

### 21. Android/iOS - To close app.

Command

```java title="Java"
"Map<String, Object> params = new HashMap<>();
params.put(""name"", ""com.Pcloudy.appiumdemo"");
Thread.sleep(3000);
System.out.println(driver.executeScript(""mobile:application:close"",params));
Thread.sleep(3000);"
```

Example

```java title="Java"
"Map<String, Object> params = new HashMap<>();

params.put(""name"", ""com.Pcloudy.appiumdemo"");
Thread.sleep(3000);
System.out.println(driver.executeScript(""mobile:application:close"",params));
Thread.sleep(3000);"
```

### 22. Android/iOS - To open app.

Command

```java title="Java"
"Map<String, Object> params1 = new HashMap<>();
params.put(""name"", ""com.Pcloudy.appiumdemo"");
params.put(""fileName"", ""PcloudyAppiumDemo-1682759228.apk"");
Thread.sleep(3000);
System.out.println(driver.executeScript(""mobile:application:open"",params));
Thread.sleep(3000);
```

Example

```java title="Java"
"Map<String, Object> params1 = new HashMap<>();

params.put(""name"", ""com.Pcloudy.appiumdemo"");
params.put(""fileName"", ""PcloudyAppiumDemo-1682759228.apk"");
Thread.sleep(3000);
System.out.println(driver.executeScript(""mobile:application:open"",params));
Thread.sleep(3000);"
```

### 23. Android - To create contact.

Command

```java title="Java"
"Map<String, Object> params = new HashMap<>();
params.put(""name"",""xyz"");
params.put(""phone"",""123567890"");
[params.put(""email"",""proxy@gmail.com](mailto:params.put()"");
System.out.println(driver.executeScript(""mobile:createContact"",params));
Thread.sleep(10000);"
```

Example

```java title="Java"
"Map<String, Object> params = new HashMap<>();
params.put(""name"",""xyz"");
params.put(""phone"",""1234567890"");
[params.put(""email"",""proxy@gmail.com](mailto:params.put()"");
Thread.sleep(10000);"
System.out.println(driver.executeScript(""mobile:createContact"",params));
```

### 24. Android/iOS - To Tap.

Command

```java title="Java"
"Map<String, Object> params = new HashMap<>();
params.put(""location"", ""140,640,0,0"");
Thread.sleep(2000);
System.out.println(driver.executeScript(""mobile:touch:tap"",params));
Thread.sleep(2000);"
```

Example

```java title="Java"
"Map<String, Object> params = new HashMap<>();
params.put(""location"", ""140,640,0,0"");
Thread.sleep(2000);
System.out.println(driver.executeScript(""mobile:touch:tap"",params));
Thread.sleep(2000);"
```

### 25. Android/iOS - To Type Text

Command

```java title="Java"
"Map<String, Object> params = new HashMap<>();
params.put(""text"", ""Hello Bangalore"");
Thread.sleep(1000);
System.out.println(driver.executeScript(""mobile:typetext"",params));
Thread.sleep(2000);"
```

Example

```java title="Java"
"Map<String, Object> params = new HashMap<>();
params.put(""text"", ""Hello Bangalore"");
Thread.sleep(1000);
Thread.sleep(2000);"
```

### 26. Android - To Biometric automation on Android devices.

Command

```java title="Java"
"Object obj1 = driver.executeScript(""Pcloudy_biometric"", true/false);
Thread.sleep(5000);
System.out.println(""@Output: "" + obj1);
Thread.sleep(5000);
```

Example

```java title="Java"
"Object obj1 = driver.executeScript(""Pcloudy_biometric"", true/false);
Thread.sleep(5000);
System.out.println(""@Output: "" + obj1);
Thread.sleep(5000);
```
