How to push/pull files to/from a Real Device (Android/iOS) with Appium (on LambdaTest?

How to push/pull files to/from a Real Device (Android/iOS) with Appium (on LambdaTest?

Hey Tim,

Appium (in Java) provides pushFile method for pushing a file/folder to a specified path on the device.

Pushing file to the device

driver.pushFile("/sdcard/Download/file-name.png", new File("/Users/user-name/Downloads/file-name.png"));
Thread.sleep(500);

On similar lines, Appium (in Java) also provides pullFile method for pulling a file/folder from a specified path on the device.

Pulling file from the device

byte[] fileBase64 = driver.pullFile("/sdcard/Download/file-name.png");

if (fileBase64.length > 10)
{
   System.out.println("File Pushed Successfully");
}
else
{
    System.out.println("File Push Failed");
}

For more details on different languages, you can check out the Appium Documentation . And if you’re using LambdaTest, their guide on LambdaTest, check the documentation on Upload & Download with Appium on LambdaTest is super handy!