7

I'm trying to add a video to my Photos app in the simulator. I've been using the Safari trick (How do I add images to the iOS Simulator) for a long time but doesn't work for me with the iOS7.1 simulator.

When I drag from the Finder I get the green + sign but the video doesn't play in Safari so I can't save it to Camera Roll.

It works fine for the iOS8 simulator with Xcode6.

Community
  • 1
  • 1
Paul Cezanne
  • 8,629
  • 7
  • 59
  • 90
  • 1
    You should be able to do this by dragging the video into your applications folder, and then inserting it programmatically. See this post... http://stackoverflow.com/questions/2571656/iphone-how-do-i-add-videos-to-ipad-simulator – timgcarlson Sep 04 '14 at 15:52
  • 1
    perfect, that worked. Stick that into an answer and I'll give you green checkmark. Thanks! – Paul Cezanne Sep 04 '14 at 15:59

3 Answers3

9

As of iOS 12, simply drag and dropping the video directly on the Photos app in the simulator seems to do the trick!


I'm facing the same problem with iOS 7.1 Simulator but I found the following solution.

  1. Run 8.3 Simulator
  2. Drag the video (make sure its in the right format) over the Simulator, Safari should open it and start playing it.
  3. Tap the Done button and copy the URL you see at the top, in the Safari searchbar
  4. Run 7.1 Simulator
  5. Open Safari, paste the URL you just copied into the searchbar and press Enter. The video should open and start playing.
  6. Tap Done, tap the share button and then choose "Save Video".
  7. Your video should now be in the camera roll.

Hope this helps

halfblood17
  • 657
  • 1
  • 6
  • 21
4

Per your request to copy my above comment into an answer...

You should be able to do this by dragging the video into your application's folder, and then inserting it programmatically. See this post.

Glad that worked for you! Obviously, make sure that's not in any production code.

timgcarlson
  • 3,017
  • 25
  • 52
3

Rename the file to .m4v then drag it into the simulator, Safari will open, then you can share to camera roll.

jjxtra
  • 20,415
  • 16
  • 100
  • 140