Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add photos to the iPhone Simulator for OSX? [duplicate]

Tags:

iphone

I have photos on my Mac that I would like to add to the iPhone Simulator to test my application.

In other words: how do I add photos to the iPhone Simulator?

Edit : What about iphone Simulator 4.0 ? iphone Simulator 3.0 & 4.0 both working differently.

Thanks in advance for helping me...

like image 223
Sagar Kothari Avatar asked Aug 09 '09 00:08

Sagar Kothari


People also ask

Is there an iPhone simulator on Mac?

iOS Simulator in XcodeApple's homegrown Xcode software development environment for Mac comes with its own app simulator for iOS, tvOS, watchOS, and iMessage.

Where are iOS simulators stored?

type: ~/Library/Application Support/iPhone Simulator. The Directories are the iOS version of the different Simulators. The Sub Directories are the Apps install on the simulator. The Documents folder is where the user generated content which gets backup up onto iCloud.


2 Answers

Open the Window in mac where your images are stored.

Open your simulator another side.

Now drag your image from mac window to simulator,

simulator will open safari, and in a safari tab your image will be shown.

Tap & press down on image in simulator,

There will be message to "save image",

save image.

It will be added to your iPhone simulator.

Edit :

First just look at following image.

alt text

In iPhone simulator 4.0 ( iphone/iphone simulator ), itself it maintains a sqlite database for added images. So, if you want copy paste system - first make insert entries & then copy paste. That would be ridiculous way.

Ok. Let me explain simpler way of doing it.

  • open the finder in which you have bulk images that you want to add in simulator.
  • drag & drop first image into iphone simulator
  • on image - tap & hold for 1 second.
  • action sheet will appear - tap on save option
  • repeat same process for all images
  • this will do sqlite entries also.
  • now, open the /Users/YourUserName/Library/Application Support/iPhone Simulator/4.0
  • make a back up of Media directory. ( for example copy it & paste it on desktop )
  • when you reset your iphone simulator, all images will be gone
  • you need not to repeat all the process again, you have back up of it.
  • just copy & paste from back up to 4.0

alt text

like image 160
Sagar Kothari Avatar answered Sep 22 '22 13:09

Sagar Kothari


A more easy to understand version of sagar's answer:

Open a Finder window to where your images are stored and the iPhone Simulator. Then drag the images from the Finder window into the simulator. The simulator will open Safari with your image. Click and hold to save the image to the iPhone camera roll. You can now use those images as you normally would.

like image 41
Darryl Hein Avatar answered Sep 22 '22 13:09

Darryl Hein