How to take Iphone 4 screenshots with Xcode 8 - ios

This SO post gives the image resolutions needed for the Xcode Images.xcassettes when doing the launch image for the Iphone. One of the images needed is the 2x for the Iphone 4. However, since upgrading to Xcode 8, the target builds are only Iphone 5 and above. How do I get a screenshot from the Iphone 4?

Xcode -> Preferences -> Components
Install older version of simulator and iPhone 4S will appear in simulator list.
4 and 4S had identical screen resolutions.
P.S. You also need to set project deployment target to the older version you installed

Don't Take.
In XCode 8.0, You are set deployment target 8.0+, it means in You are developing apps for iOS 8.0 and later. iOS 8 and later will be compatible with iPhone 4s, iPhone 5, iPhone 5c, iPhone 5s, iPod touch 5th generation, iPad 2, iPad with Retina display, iPad Air, iPad mini, and iPad mini with Retina display. So it looks like the iPhone 4 is officially dead to Apple.
You are take iPhone 4S screen shot. if You are set the deployment target 8.0.

Related

How to assign launch images in Xcode assets catalog?

Xcode's interface for assigning launch images into an assets catalog is rather confusing. Only 2 image slots are made available given the settings we've chosen (Portrait only, for iOS 8.0 and later) and yet the Apple docs list a variety of resolutions required for their various devices (6s, 6s Plus, 7, 7 Plus, etc.), 12 of them to be exact. I'm using Xcode 8.3 btw.
We are designing portrait images for commonly available devices, but how to assign them here? Notice pics below showing a confusing mismatch between the expected resolutions of images (straight from Apple docs) and the Xcode UI for assigning those images. There are only 6 slots available, and even if the Apple docs described only 6 images, it is impossible to tell which goes where.
EDIT: Deployment target is 8.3.
Depending on your deployment target, there's either 3 or 4 total resolutions you need to care about: 5.5" devices, 4.7" devices, 4" devices (e.g. iPhone SE), and if your deployment target is iOS 9 or below then 3.5" devices (e.g. iPhone 4S).
The "iOS 8.0 and Later" iPhone Portrait gives you the 5.5" and 4.7" devices. If you check the "iOS 7.0 and Later" iPhone Portrait option that will give you "2x" (which I believe is 3.5" devices) and "Retina 4" (which is 4" devices).
Using those 4 options you'll be able to cover all supported iPhones.
If you need iPad support, you can check the relevant iPad checkbox. However, it looks like the asset catalog doesn't offer a slot for either iPad Pro, I don't know why not. This answer suggests that for the iPad Pro you should ditch the asset catalog entirely and switch to free images and Info.plist keys.
You also don't need 12 images for 12 devices. A bunch of the devices share the same resolution. Here are the images you need:
2048x2732 - 12.9" iPad Pro
1668x2224 - 10.5" iPad Pro
1536x2048 - 9.7" iPad, 7.9" iPad mini 4
1242x2208 - iPhone 6s Plus, iPhone 7 Plus, iPhone 8 Plus
750x1334 - iPhone 6, iPhone 6s, iPhone 7, iPhone 8
640x1136 - iPhone 5, iPhone 5s, iPhone 5c, iPhone SE
640x960 - iPhone 4s
If you upgrade to Xcode 9 you'll also need an 1125x2436 image for the iPhone X.
If you would just use a launch storyboard like everyone else, you wouldn't be having any problem. You would just supply one launch storyboard: end of story.
EDIT As of iOS 13 and Xcode 11, this will soon be required. Launch images are dead. Your app must have a launch storyboard.

How to I add simulator for iphone 4/5 in Xcode 6.3.1

I am not sure if i am doing it right. Please help.
To add simulator, goto > windows > devices
problem:
1) When I tried to add simulator for iphone 5 or 4 , it show iOS version 8.3
the dialogbox show :
Simulator name : iphone 4s
Device Type : iphone 4s
iOS version : iOS8.3
Is this correct? iphone 4s should be using ios lower than ios 8 right?
How to I do testing for iphone 4/5 using simulator ?
In the Xcode menu, go to Windows > Devices, and at the bottom left click on the + button.
Xcode 6 only supports iOS 7 and iOS8. You could use iOS 7 for iPhone 4s or iPhone 5, just install the iOS 7.1 simulator from
Xcode > Preferences > Downloads.
iPhone 5 and iPhone 4S can be updated to run iOS 8, so it is perfectly ok to test iOS 8 with these phones.
Is this correct? iphone 4s should be using ios lower than ios 8 right?
It is correct. I have an actual iPhone 4s and it is running iOS 8.3. (In fact, it is my primary development testing device for iOS 8.)
You can install earlier simulators, but there is nothing wrong with what you're seeing.
(And yes, this means that in order to develop for iOS 8, you need to support screen sizes ranging from the tiny iPhone 4s to the massive iPhone 6 Plus. Good luck.)

Set App to run on iPhone 5+

Really simple question but can't find a answer anywhere. How do I set it so my app (iOS App Store) can only be downloaded by iPhone 5+? e.g iPhone 5, iPhone 5s, iPhone 6 and iPhone 6 Plus only. No iPhone 4s or lower.
There is no option for that. There is only option where you can set minimum iOS version.
You can set minimum iOS version from Deployment Target option.

3.5" Simulator in Xcode 6.0.1

I have currently updated my Xcode from 5.1.1 to 6.0.1 to support apps for iOS 8.0. But I could not find any 3.5" simulator. Is the 3.5" simulator has been removed, or Apple is not going to support the 3.5" iPhone Devices any more?
You can pick the iphone 4S, which has a 3.5" screen.
For XCode 6 and onwards XCode has simulators based on devices as shown in following screenshot
Apple is still supporting iPhone 4s with latest iOS 8 , so you can select that
From Xcode 6 beta onwards apple have added simulators with device names so you can pick iPhone 4s for 3.5" simulator and iPhone 5 for 4" simulator.
Open Xcode -> Preferences -> Downloads
There you can download the simulator for the iOS which you want.

Why is iPhone not available in Hardware -> Device

On my simulator under Hardware -> Device I only see iPhone Retina but not iPhone alone.
Is there a reason for this? am I missing iPhone?
If your project's Deployment Target is iOS 7.0 or later then that is why you don't see non-retina iPhone choices.
iOS 7 doesn't run on any non-retina iPhones or iPod Touches
iOS 7 does run on the iPad 2 and the non-retina iPad minis, which is why you do see the iPad option

Resources