iOS simulator photos app

I’m writing a test for my iOS app’s feature that allows users to upload a picture. When the user click on the “Choose a photo”
link in my app, the iOS photos app should launch and the users will be able to pick a photo from their iOS photos.

In the iOS simulator photos app, there are some stock pictures. Is it possible to attach pictures from the photos app into my app?
From my application when I click “choose a photo” (though the automation code), my app just crashes. I checked the Appium logs,
but could not find anything informative.

Am I missing some setup here? How do I debug this further?

Even I want to know how to uplaod pic in iOS?


public void addPhotoToSimulator(String fileName) {
  executeShell(new String[]{"xcrun", "simctl", "addmedia", deviceUDID, pathToFile + fileName});

@Aleksei I’m using java I want to upload pics to Hybrid ios app using Appium

what will be the approch? and any peace of code that helps and also Horizontal scroll of hybrid app?

Thanks in advance



  1. this is Java
  2. i gave code to upload tested image into iOS Simulator gallery (“executeShell” is just mine custom function to execute command line code. choose any you know way on Java.)
  3. all is left to use it and with your app just tap gallery link and tap on LAST image (uploaded will be last image)

Thanks @Aleksei

Any idea of Hybrid app vertical and horizantal scroll of app?

Hi Alekseo,

I am doing automation in iOS with real device. How do I select photo from Library.

there is pushFile functionality with Appium now. other steps are per your application under test.

@Aleksei Thanks it worked.