Getting Photos Into the iOS Simulator

Here is a little tip a picked up over here. I am building an app that uses the UIImagePickerController. However, I was getting annoyed because it was a little difficult to test it in the simulator because there are no photos in the simulator's photo library. So here is what I did.

  1. Fire-up the iPhone simulator and then run the Safari web browser.
  2. On your computer, open the folder that contains the photo(s) you want to put into the Simulator.
  3. Drag an image from the folder and drop it onto the Safari browser window open in the Simulator.
  4. The image will then appear in Simulator's web browser.
  5. Click and hold on the image and you will see a "Save Image" dialog box appear. Click to save.
  6. Close Safari and go to Photos on the Simulator. You should now see your photo in there.

This worked out great as I can now perform basic image selection routines from within the Simulator using real-world example content.