How do I put images on the iPad Simulator - iphone

Is there anyway of placing images on the iPad simulator?

You can save images from Safari.
I don't think there is a different (easier) way.

if you drag and drop from the OS onto the simulator, it will load the image into safari, where you can then save to your camera roll

I've done this by writing a little throwaway app that contains the images I want, then use the UIImageWriteToSavedPhotosAlbum API call to save them from my bundle.

Related

How to add photos to simulator's Camera roll in UI Tests

I have app which recognize image chosen from Camera roll (CoreML). Now I want to write some test for this to not have to click it through every time I make a change in the app. How can I put testing images into simulator's Camera roll programatically, so somebody else would just run the test and it would do everything for him?
You can go into safari on the simulator and search for images. Save the images and you should have access to them in the camera roll. If you must do it programmatically, then this link might help.
swift Take a photo and save to photo library

PNG within an iPhone app

I have the following issue:
My iPhone app makes some kind of graphics.
How can I save these graphics or drawings made by the app as a png file on the device?
Would it then be possible to set such a png file to become the icon for the app from within the app itself? (Provided the size is right of course.)
Thanks for any possible tip.
No, you can't change the app's icon at runtime (like the Calendar app that comes with the iPhone does)
How do I change the default icon of iPhone application programmatically?
For saving PNG images on your device, look into UIImagePNGRepresentation which is part of the UIImage Class.
As for changing the app icon, this would only be possible if you are jailbroken and have the right package dependencies that allow the icons to refresh in SpringBoard on the fly.
Outside of being Jailbroken, changing the app icon would require an app update which would include the new icon.
I wouldn't think it's possible for the actual icon for the app to change, because it's set on the phone when the app is installed.

Capturing image through camera, even being inside application

Is it possible to make camera work from, application code? As here is need to capture Image inside my application through iPhone camera. And to upload that on web.
Yes.

How to add images to iphone simulator v4

I've always been able to get images into iphone simulator 3 by the usual methods described on this site (i.e. dragging image into iphone simulator).
However, having upgarded to the new xcode 3.2.3, although I can still save images to the simulator, I can't actually see them there when I go to the library on the simulator.
Thankfully - it works when I build for the iPad simulator.
Has anyone else go this problem or is my install of the new xcode screwy?
I've noticed that you can add them if you change the device in the Hardware menu. Switch to iPhone and do the usual. Then switch back to iPhone4 and you'll be able to see the images in the photo library.
alt text http://img.skitch.com/20100705-8kra9hetayjqhyu3i5w4brayr4.png
You should also file a radar with Apple. ;-)
I was had the same problem after v4 upgrade but it seems to work if I drag the images into an album in the actual 'photos' app.
You can save images in the simulator by going to Safari on the iPhone,iPad.
Navigate to some URL eg, hot pictures of Megan Fox on google images. Click and hold on your favourite image of here, hopefully in a very hot pose. Then select save from the menu that appears.
This normally does it for me.
[UPDATED]
Sorry this does not work on 3.2.2 but has worked in the past.
Seems that you need to run the Photos app on the simulator after dragging in images in order for it to make the images available from your app.
First you simply run simulator then tap on back button after this drag image from your macbook u found small image on simulator screen hold courser on image
after a while bring a pop-up screenView on iPhone simulator screen to ask that you want to save this image or cancel
you just save and go back
open photo gallery you must be see one image in photo gallery

Iphone 4 Simulator, Set Background Image?

I noticed on Xcode 3.2.3 that of the three simulators available both the iPhone(water drops) and iPad(night sky) show background images. Is there a way to add a few photos to Photos so that I can set one as a backdrop.
NB: I tried dragging an image to Safari in the simulator and then clicking/holding and saving but the image does not show up in Photos.
Gary.
Tapping and holding on an image viewed in Safari allows you to add the selected image to the Photo application. When the message pop-up appears choose "Save Image". Quit Safari and go to the Photo application. The image should be in the camera roll.
I have tried this technique before and it has always worked for me.
Try putting some images in the following directory:
~/Library/Application Support/iPhone Simulator/User/Media/DCIM/100APPLE
Create the 100APPLE directory if it doesn't already exist. Then add some images in the format of:
IMG_0000.JPG
IMG_0001.JPG
IMG_0002.JPG
IMG_0003.JPG
I think this might be case sensitive as well.