How to add video to iphone simulator

Viewed 22482

Can anyone tell me how to add video the iPhone simulator so that I can test some apps I am working on? Thanks in advance!

10 Answers

For 2022, if you try to import a .mov file directly from the Downloads folder the simulator gives a vague error (PHPhotosErrorDomain error -1). To solve this move the video into your root /~ directory and drag it into the simulator.

XCode Version - 13.2
Simulator iOS Version - 15.2

It's been a while... Drag and drop somehow didn't work for me with video file (for both .mov and .mp4). So I adopted obj-c code from one of the answers

let path = Bundle.main.path(forResource: "Video", ofType: "mov")!
UISaveVideoAtPathToSavedPhotosAlbum(path, nil, nil, nil)
Related