Last updated on : 09 Jan 2026
Pcloudy Mobile Commands (Advanced Appium Actions)
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:
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
driver.executeScript("Pcloudy_executeAdbCommand", "ADB_COMMAND");
Example
Object obj = driver.executeScript("Pcloudy_executeAdbCommand", "adb devices"); System.out.println("@Output: " + obj);
2. Set Android Device Location**
Command
Map<String, Object> params = new HashMap<>();
params.put("latitude", "28.6139");
params.put("longitude", "77.2088");
driver.executeScript("Pcloudy_setAndroidLocation", params);
Example
System.out.println(driver.executeScript("Pcloudy_setAndroidLocation", params));
3. Toggle Device Location (Android / iOS)
Command
driver.executeScript("Pcloudy_switchDeviceLocation", "true/false");
Example
driver.executeScript("Pcloudy_switchDeviceLocation", "true");
4. Enable or Disable Wi-Fi on Android
Command
driver.executeScript("Pcloudy_enablewifi", "true/false");
Example
driver.executeScript("Pcloudy_enablewifi", "true");
5. Android/iOS - To get a video for every test case during Appium session.
Command
Map<String, Object> params = new HashMap<>(); params.put("enableRecord", true); System.out.println(driver.executeScript("mobile:video:record",params));
Example
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
Map<String, Object> params = new HashMap<>(); params.put("enableRecord", false); System.out.println(driver.executeScript("mobile:video:record",params));
Example
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
driver.executeScript("Pcloudy_getReportLink");
Example
String link = (String) driver.executeScript("Pcloudy_getReportLink"); System.out.println(link);
8. Android/iOS - To get the link to see the live view of stream based devices.
Command
Map<String, Object> params = new HashMap<>(); params.put("getDeviceUrl", true); System.out.println(driver.executeScript("mobile:device:url",params));
Example
Map<String, Object> params = new HashMap<>(); params.put("getDeviceUrl", true); System.out.println(driver.executeScript("mobile:device:url",params));
9. Android - Biometric automation on Android devices.
Command
Map<String, Object> params = new HashMap<>(); params.put("auth", true); System.out.println(driver.executeScript("mobile:fingerprint:auth",params));
Example
Map<String, Object> params = new HashMap<>(); params.put("auth", true); System.out.println(driver.executeScript("mobile:fingerprint:auth",params));
10. iOS - Biometric automation on iOS devices.
Command
Map<String, Object> params = new HashMap<>(); params.put("auth", true); System.out.println(driver.executeScript("mobile:biometric:auth",params));
Example
Map<String, Object> params = new HashMap<>(); params.put("auth", true); System.out.println(driver.executeScript("mobile:biometric:auth",params));
11. Android/iOS - To inject QR code image.
Command
"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
"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);"
12. Android/iOS - To start network simulation.
User can get information about all the network profiles available according to that user can simulate the network.
Command
Map<String, Object> params = new HashMap<>();
params.put("profileName", "4G-LTE-Advanced");
System.out.println(driver.executeScript("mobile:network:start",params));
Example
Map<String, Object> params = new HashMap<>();
params.put("profileName", "4G-LTE-Advanced");
System.out.println(driver.executeScript("mobile:network:start",params));
13. Android/iOS - To reset network profiles.
Command
Map<String, Object> params = new HashMap<>();
params.put("profileName", "4G-LTE-Advanced");
System.out.println(driver.executeScript("mobile:network:stop",params));
Example
Map<String, Object> params = new HashMap<>();
params.put("profileName", "4G-LTE-Advanced");
System.out.println(driver.executeScript("mobile:network:stop",params));
14. Android/iOS - To get all the text present in an image.
Command
Map<String, Object> params = new HashMap<>();
driver.executeScript("mobile:ocr:text",params);
15. Android/iOS - To compare and find the difference between two images.
Command
Map<String, Object> params = new HashMap<>();
params.put("baseImageId", "firstImageId");
params.put("secondImageId", "secondImageId");
driver.executeScript("mobile:visual:imageDiff",params);
16. Android/iOS - To verify if any word exists or not in an image.
Command
Map<String, Object> params = new HashMap<>();
params.put("imageId", "ID");
params.put("word", "abc");
System.out.println(driver.executeScript("mobile:ocr:textExists",params));
17. Android/iOS - To find the coordinates of a word.
Command
Map<String, Object> params = new HashMap<>();
params.put("imageId", "ID");
params.put("word", "abc");
System.out.println(driver.executeScript("mobile:ocr:coordinate",params));
18. Android/iOS - To start the transaction execution with HAR file.
Command
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);
19. Android/iOS - To stop the transaction execution.
Command
Map<String, Object> params = new HashMap<>();
driver.executeScript("mobile:transaction:stop",params);
20. Android/iOS - To rotate the device in landscape mode.
Command
Map<String, Object> params = new HashMap<>();
params.put("orientation", "L");
System.out.println(driver.executeScript("mobile:device:rotate",params));
21. Android/iOS - To rotate the device in portrait mode.
Command
Map<String, Object> params1 = new HashMap<>();
params1.put("orientation", "P");
System.out.println(driver.executeScript("mobile:device:rotate",params1));
22. Android/iOS - To close app.
Command
"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
"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);"
23. Android/iOS - To open app.
Command
"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
"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);"
24. Android - To create contact.
Command
"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
"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));
25. Android/iOS - To Tap.
Command
"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
"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);"
26. Android/iOS - To Type Text
Command
"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
"Map<String, Object> params = new HashMap<>();
params.put(""text"", ""Hello Bangalore"");
Thread.sleep(1000);
Thread.sleep(2000);"
27. Android - To Biometric automation on Android devices.
Command
"Object obj1 = driver.executeScript(""Pcloudy_biometric"", true/false);
Thread.sleep(5000);
System.out.println(""@Output: "" + obj1);
Thread.sleep(5000);
Example
"Object obj1 = driver.executeScript(""Pcloudy_biometric"", true/false);
Thread.sleep(5000);
System.out.println(""@Output: "" + obj1);
Thread.sleep(5000);
Did this page help you?