appiumaws-device-farm

How can I upload a picture to a device while running appium script on AWS' device farm


String imagePath = this.getClass().getResource("/files/images.jpg").getPath();
driver.pushFile("/data/local/tmp/image.jpg", new File(imagePath));

This code works fine on emulators & real device but doesn't work on device farm of AWS


Solution

  • Device farm uses physical devices and is recommend using /sdcard/ directory to pushFile. While on emulators you can use directories like /data/. This solution for work for your use case. Let us know if you see this issue again