Automate uploading file to native app using appium and java

How can I push (image/video/audio)file to ios device photos/gallery so that I can upload in application for automation. And also how can I pull that specific file as I cannot click on that file bcos xpath(showing date and time) is not unique as android

Can someone help to send code or link for reference

I tried following code to push file in iphone but I couldn’t find file under photos
public void pushFileInIOS(String fileName) throws IOException {
String filePath = dir + “/testingFiles/” + fileName;
String appDocumentPath = “/var/mobile/Containers/Data/Application/App- Id/Documents/TestingImage.jpeg”;
// Push the image to the iPhone
File imageFile = new File(filePath);
((IOSDriver) driver).pushFile(appDocumentPath, imageFile);
System.out.println(“Image pushed to iPhone successfully!”);
// Automate the app to upload the image
uploadImage();
}

Can someone help who has previous experience on mobile automation -iphone

last time i did it 7y ago → iOS simulator photos app - #3 by Aleksei

@Aleksei Can it be done on real IOS devices too ?

With real device no.

I see, thanks Aleksei for information