Adding photos to the iPhone simulator

Mar 13, 2012 · Follow on Twitter and Mastodon ios

I’m currently building an iOS app that will make use of the device camera. It works well, but since I’m also running this app on 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:

No Photos iPhone screen

Uhm, can I? I haven’t found a way to do so, but there’s an easy workaround for this so that you easily can add photos to your simulator.

Just open up Finder and drag any image you want to add into your simulator. When you see the green plus icon, just release the image. The image will then open up in Safari, like this:

Safari browser screenshot

Click the image and keep the mouse button pressed. You now get an option to save the image:

Save option

That’s it! If you open up the photo library, you will see the image in your list of saved images:

Photo library

You can then use it as you see fit in the simulator.

Hope it helps!

Discussions & More

Please share any ideas, feedback or comments you may have in the Disqus section below, or by replying on Twitter or Mastodon..

If you found this text interesting, make sure to follow me on Twitter and Mastodon for more content like this, and to be notified when new content is published.

If you like & want to support my work, please consider sponsoring me on GitHub Sponsors.