Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How To Push Video on iPhone Simulator?

I would like to push a video into iPhone simulator to test video picking in UIImagePickerController. Is it possible to do that? And if it possible, could you please provide me with some advices?

Thanks.

like image 604
Lyubomyr Dutko Avatar asked Aug 17 '09 12:08

Lyubomyr Dutko


3 Answers

None of the other methods suggested here worked for me, but I found a way that works on the latest version (6.1) of the simulator:

  1. Start up the simulator and navigate to the photos app from the home screen.
  2. Drag and drop an .m4v file from your file system onto the simulator window. The video will now be playing in safari.
  3. Click "done" in the upper left hand corner.
  4. Click on the "share" button and select "save to camera roll"

You're done!

like image 155
Pwnosaurus Avatar answered Oct 21 '22 06:10

Pwnosaurus


I made it easier: first, I recorded a sample screencast with QuickTime X and saved it for iPhone. then, I copied it to '~/Library/Application Support/iPhone Simulator/User/Media/DCIM/100APPLE/VID_0001.m4v' (maybe you'll need to create 100APPLE directory). relaunched iPhone simulator and saw my video under 'Saved Photos' in Photos.app. when I use UIImagePickerController, that video is there and I'm able to choose it.

If that helps, I use SDK 3.2.1 on 10.6.2.

like image 22
sgosha Avatar answered Oct 21 '22 04:10

sgosha


You can subclass UIImagePickerController to override its behaviour and provide your own view. If you do this, you can then call imagePickerController:didFinishPickingMediaWithInfo: and supply your own pre-recorded video. If you include a video actually recorded from an iPhone 3GS, the behaviour you get will be pretty damn similar to that of the actual device.

Of course, always always always test on a real device before shipping!

We use a subclass of CLLocationManager in a very similar fashion to give a better location simulation.

like image 22
iKenndac Avatar answered Oct 21 '22 06:10

iKenndac