Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

add photos to iPhone simulator

I need than on button click opens iPhone's default album and I'll can chose a photo.

I read a lot about this, but still don't works. I do the following:

  1. ~/Library/Application Support/iPhone Simulator/User/Media/DCIM/100APPLE/ I'm storing two pictures IMG_0000.JPG (300 on 300 px) and IMG_0000.THM (75 on 75px)
  2. In my app I do the following on button click:
- (IBAction) btnOpenAlbum
  {
      album = [[UIImagePickerController alloc] init];
      album.delegate = self;  

      album.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

      [self presentModalViewController: album animated:YES];
  }

I tried also UIImagePickerControllerSourceTypePhotoAlbum and still no photos in album.

AI solved it in such a way:

  • Opened iPhone simulator.
  • Drag there photos. And it automatically copy it to folder ~/Library/Application Support/iPhone Simulator/4.1/Media/DCIM/100APPLE and named them as IMG_0001.PNG IMG_0002.PNG and so on.

After that all works fine, but: When I tried to copy item directly to that folder, and give them suitable names, iphone didn't recognized them. And also, when I deleted them from that folder and run simulator - photos where on simulator, but in folder they were not.

What it can be? Thanx.

like image 818
yozhik Avatar asked Nov 19 '10 09:11

yozhik


People also ask

How do you put videos on iPhone simulator?

Make it visible or user Terminal. Navigate to ~/Library/Application Support/iPhone Simulator/ If you have multiple iOS Simulators pick the one your are developing for currently. (I had 5.0, 5.1, 6.0 and 6.1) Navigate to ~/Library/Application Support/iPhone Simulator/6.1/Media/DCIM/100APPLE/ and drop in your video file.


1 Answers

AI solved it in such a way:

Opened iPhone simulator. Drag there photos. And it automatically copy it to folder ~/Library/Application Support/iPhone Simulator/4.1/Media/DCIM/100APPLE and named them as IMG_0001.PNG IMG_0002.PNG and so on. After that all works fine, but: When I tried to copy item directly to that folder, and give them suitable names, iphone didn't recognized them. And also, when I deleted them from that folder and run simulator - photos where on simulator, but in folder they were not.

like image 91
yozhik Avatar answered Oct 06 '22 00:10

yozhik