Adding photos to the iPhone simulator
Mar 13, 2012 ·
I’m building an iOS app that makes use of the device camera. It works well, but since I’m also using the simulator, I want to be able to select pictures from the photo library as well.
However, once I open up a UIImagePickerControllerSourceTypePhotoLibrary
dialog in the iPhone simulator, I’m presented with the following screen:
Can I? I haven’t found a way, but there’s a workaround that can add photos to a simulator.
Just open up Finder and drag any image you want to add into the simulator. When you see the green plus icon, just release the image. The image will then open up in Safari, like this:
Click the image and keep the button pressed. You now get an option to save the image:
That’s it! If you open up the photo library, you’ll see the image in your list of saved images:
You can then use it as you see fit in the simulator.
Hope it helps!
Discussions & More
If you found this interesting, please share your thoughts on Bluesky and Mastodon. Make sure to follow to be notified when new content is published.