'How to add images to iPhone Simulator?
I have used UIImagePickerController with UIImagePickerControllerSourceTypePhotoLibrary, but it says "No photos".
Where does the simulator get the images from? Where should I copy the images so that they are displayed in the simulator?
Solution 1:[1]
Now you can do this easily just by dragging and dropping the images in to Photos app in iPhone Simulator.
Solution 2:[2]
- Run the simulator
- Run Safari on the Simulator
- Drag a picture onto Safari running on the Simulator, this opens the image.
- Click and hold on the image, or tap on the share icon in the bottom tool bar.
- You will get an alert asking if you want to store the image to your phone
Solution 3:[3]
If someone gets an error similar to
One or more media items failed to import:
/Users/Username/Desktop/Screenshots/Screen Shot 2021-07-09 at 12.05.29.png: The operation couldn’t be completed. (Cocoa error -1.)
You can try to move the picture to the user's root folder. In my case /Users/Username/Screen Shot 2021-07-09 at 12.05.29.png, and I was able to drag and drop my image from Finder to the simulator.
Solution 4:[4]
- Open photo on simulator. The gallery will open.
- Drag the pic you want into the simulator gallery.
- That's it. The pic is now on the gallery.
Solution 5:[5]
You can drag files like images or video from your local mac machine to simulator once you open the photos or video list of the iphone.
But make sure you're uploading from Documents folder else it won't get uploaded if you drag files from other folders.

Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Vinoth Vino |
| Solution 2 | Mats |
| Solution 3 | John |
| Solution 4 | Pang |
| Solution 5 | jyotishman saikia |
