Xcode 4.5 and iOS 4.2.1 incompatibility - ios

The latest release notes indicates 4.2.1 and lower will not be supported, we now have to use 2 version of Xcode to develop when supporting older devices?? This is going to be difficult to support older devices if we want to develop iOS6 AND support 4.2 and lower.
I don't think Xcode 4.4 will support iOS6. So this is the issue. How would developers easily support these platform without so much hassle?

You can do this, but it requires some minor Xcode hacking, and some sacrifices. Depending on what you mean by "support iOS 6", this may or may not be sufficient for you. If you just want your app to run on iOS 6, then this should work. If you also need your app to incorporate new iOS 6 features, then it won't.
(Note for others who don't have a problem using multiple versions of Xcode: this similar question has answers that do allow you to also use new iOS 6 APIs and directly target armv7s)
See basic instructions on chpwn's blog here (but read the rest of this below, too!)
Basically, you can use Xcode 4.5 to build for iOS 4 and above, but then you can't take advantage of the new iOS 6 only features. So, you're really building for iOS 4 and 5, and assuming that the app will run fine on iOS 6 (which should be true, but you'll need to test this yourself).
You'll need to copy the iOS 5 SDK folder
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.*.sdk
from an old Xcode installation (which you'll need to keep around briefly, or reinstall to a non-standard location). You'll then set the Deploy Target in your Build Settings to iOS 4.0 (or whatever minimum OS you want). You may need to open the project.pbxproj file in a text editor to set this manually:
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
You'll also need to set the Architectures to armv6 and armv7. You cannot directly also target armv7s. But, that doesn't mean your app won't run on iPhone 5. armv7 executables should run on iPhone 5, simply without any optimizations added in armv7s. It's just that compatibility doesn't work in the other direction (e.g. armv7 executables don't run on an armv6 iPhone 3G).
There's also a step that might be necessary, that's not mentioned in chpwn's blog. You may get these warnings (which really are errors, because Xcode won't generate your executable properly):
warning: no rule to process file '$(PROJECT_DIR)/main.m' of type sourcecode.c.objc for architecture armv6
In order to fix this, you'll need to setup a custom Build Rule for your target that tells Xcode to use LLVM GCC 4.2 to generate armv6 code. Define the rule for files matching the pattern *.[mc]:
This will be a different compiler than the Xcode default, and you may need to adjust some of the syntax in your Objective-C code. Even though many people wanting to do this probably wrote their apps before ARC, it is important to note that LLVM gcc 4.2 does not support ARC.
Finally, you probably will still see warnings from Xcode about iOS deploy targets less than 4.3, and armv6 not being supported. Those, I found, were not problems, and could be ignored:
Running lipo -info on my app executable after this shows the desired result:
lipo -info MyAppName
Architectures in the fat file: MyAppName are: armv6 armv7

Xcode 4.5 makes iOS 4.3 the earliest supported operating system, which effectively orphans the original iPhone and the 3G.
If you want to support iOS versions earlier than 4.3, you will need to keep around a 4.4 version of Xcode.
To be a bit clearer : you cannot easily (meaning Xcode does not out-of-the-box) support pre-4.3 devices and use iOS 6 features in the same app. That's because iOS 6 features require XCode 4.5 which also sets iOS 4.3 as the minimum supported OS.
So, you have 3 choices :
Continue using XCode 4.4. You'll be able to target pre-4.3 iOS. You won't be able to take advantage of iOS 6 features, but your app should run fine on it assuming you perform adequate testing on actual iOS 6 devices.
Migrate to XCode 4.5. You won't be able to target pre-4.3 iOS, but you'll be able to take advantage of iOS 6 features.
Make two versions your app. Build one version with XCode 4.4 (as in option 1), and the other with 4.5 (as in option 2). From the point of view of distribution, these will be 2 separate apps, they'll each have their own bundle ID, etc. You will have two entries in the app store.
If you are comfortable going beyond what is supported directly by Xcode, see Nate's answer.

The original iPhone and iPhone 3G are the only devices that don't support iOS 5. The iPhone 3G is now 4 years old. You may want to consider dropping support for iOS 4. If you don't want to do that, I think you'll have to develop in two different versions of Xcode.

I assume that the dropped support for iOS 4.2.1 is not the core problem. In fact, I tried to work around this and do the following:
Build the app with iOS 6 SDK, setting deployment target to iOS 4.2.1 (which works).
Pack the app for ad hoc installation and install the app on an iOS 4.2.1 device (iPod touch 2G).
Test the app.
However, installation fails. The reason here is - afaik - not the iOS version. The reason is the architecture. XCode 4.5 no longer allows you to build for armv6. It only builds for armv7. On the other hand: all device which have armv7 or better can run iOS 5. The only devices which do not support armv7 are iPhone, iPhone 3G, iPod touch 1G and iPod touch 2G.
So for me the question is: can you build for armv6 with XCode 4.5 and iOS 6 as base SDK?
Edit: Which you cannot do, because the iOS 6 base SDK is not available for armv6. Right?

Try to set the project settings manually using IPHONEOS_DEPLOYMENT_TARGET=4.0. However, I don't know if there is any side effect.

I think that targeting to 4.3 is the best choice, according to ios version statistics

Related

Minimum target iOS version/device platform for iPhone-App to get uploaded at AppStore

what is the allowed minimum target iOS version and device platform for a new iPhone App to get uploaded on AppStore
Apple support iOS 4.3 see Setting Deployment Info. But support 64-Bit Binary minimum deployment target of iOS 5.1.1
Apple has officially announced apps need to be compiled with Xcode5 starting February 1, 2014:
So you must have Xcode5 for submission app in to app store. And in to xCode5 we can not define device platform like(iPhone4,iPhone4s,iPhone5,iPhone5s.. etc.) we can set deployment Target so you can setting minimum deployment target is 6.0 if you want to less then 6.0 and if you are not find that Option like Bellow image you can directly type in to Deployment Target filed.
Building with Xcode 5 is currently required for iOS App Store submission. Xcode 5 does not include an armv6 compiler, thus does not support building for the original iPhone (2G) or the iPhone 3G, which only run armv6 code, or for iOS versions below 4.3, which also require armv6 code. So the 3GS and iOS 4.3 and newer are the supported lower limits.
Note that using Xcode 5 to build arm64 binaries for the newest devices has a Deployment Target lower limit of iOS 5.1.1. Anything lower won't create a functional build.
However, there are reports that one can additionally build the app with old Xcode 4.3 or earlier, which does include an armv6 compiler, and then use lipo to combine the results with an Xcode 5 build archive to support both newer and older devices down to iOS 4.0. Manual plist editing before codesigning may also be required after using lipo. Apple might currently be approving a small number of such lipo builds, however it is unknown whether they will continue to do so.
Starting from June 1st, 2015, APP updates needs to be 64bit and built with ios8 SDK.
Please check the answer:
I think Minimum target iOS version which apple should support be 4.3.
Check this if you want to add more targets: XCode 5 deployment target limited only to iOS 7

Make Your Apps Look Great on the Retina Display vs armv6 [duplicate]

This question already has answers here:
How to support both armv6 and armv7s for release build in xcode 4.5
(7 answers)
Closed 9 years ago.
As you probably know, Apple announces two news:
Make Your Apps Look Great on the Retina Display and iPhone 5
And another one related to UDID
I've a question about the first one. So we have an application which is built with iOS3.2 as a minimum deployment target and with armv6 support. The reason for this because many user still has an iPhone 3G, so we need support for armv6.
But because of this announcement, we have to drop armv6 support and use iOS6 SDK (with iOS4.3 min deployment target) to properly build the app with the 4 cols launch image.
I was reading and searching a lot about this topic and I found these:
Currently we have armv6 support. You can't drop it, you can just set the minimum os version to 4.3. But with XCode 4.5 you can't built for armv6 architecture, so this slice will missing from the app. That's why Apple won't accept your app at next upload, because you limit the supported list of devices. But if you use older XCode, you can't add the big launch image for supporting iPhone5 full screen mode.
The main point is the missing armv6 slice.
Someone told that Apple can detect this, and if your app contains such slice, it will be rejected after May 1.
But you can't update your existing app with armv6 support, because you can't built for that.
I also read that you can combine apps built with XCode 4.x and 4.5 to support all architectures, but this is too risky for us if Apple will accept this after May 1.
So is it true that all developer whose app is still supporting armv6 must have to upload a new app to App Store with different app id? Or is there any other solution that updates after May 1 will arrive in the right manner to all current user?
Thanks
madik
There's nothing wrong with removing support for a previously-supported architecture once it's out of date, as is the case here. You will not be able to release any more updates for these users though, and that's just all there is to it.
What you can't do is remove support for a device group. That is, you can't have a universal app and later remove support for iPad, for example.
There is no point in supporting armv6 devices or OS < 5.0 any more. This market is extremely limited unless your product is targeted at countries where buying new devices is uncommon. In most major markets the effort to support ancient iOS devices is not worth it. We only support 5.x and armv7 devices for new app versions.

Has Apple removed the requirement for backward compatibility for app update

One of our app originally support armv6, and now we can update a new version only support armv7 and armv7s and update the deployment target to 4.3.
So now has Apple removed the requirement for backward compatibility for app update?
Yes. Apple has removed support for that. It had already started in ios5 itself where they removed it
In Xcode 4.3 Apple had already removed the armv6 setting from the ARCHS_STANDARD_32_BIT
But if you still want to do it then you will need to build against older ios than ios6, but then you will not be able to build for armv7s . I would suggest not doing it.
Here is the link how to go about doing it. Please take it with a grain of salt.
Link
As S. P. said, there is no support for armv6 now.
The thing is, you need to use Xcode 4.5 not so much for using armv7s but to build agains iOS 6 and to support the new iPhone 5. I mean, you can build and ship for the iPhone 5 without using armv7s at all, in fact is recommended since not many devs have an iPhone 5 at hand to test and because of many libraries fail building agains it.
Thing is, if you use Xcode 4.4.x, you will still be able to ship to armv6 devices and iOS 4.x < 4.3, but you won't be able to use any iOS 6 feature (your rotation will be completely broke, as a consequence) and forget about supporting the new iPhone 5's screen.
So Apple's decision force us to stop supporting older devices and older versions (old being 3, 4 years). There is nothing we can do about it.
A developer can not add UIRequiredDeviceCapabilities restrictions to an app's plist for required hardware for an app that is already in the App store, as that would restrict backwards compatibility.
But a developer can raise the Minimum Deployment target up to the very latest released iOS version (6.0 currently), or anything in-between (4.3 is the lowest supported by Xcode 4.5).
If an iOS device no longer supports the required OS version (armv6 devices can't run iOS 6.x, or 4.3), then it is Apple that is limiting backward compatibility, not you, the app developer, or the app itself. So youR app will meet the requirement, and Apple has recently been approving tons of apps that do so (check the updates for all the raised minimum deployment targets).

Confused about iOS 5 SDK Capabilities vs iOS 5 Capabilities of the Device

I am unclear on how to tell if a new feature of iOS 5 requires iOS version 5 running on the device or if the feature can be obtained simply by compiling with the iOS 5 SDK.
ARC is an example. I understand if it supported under the iOS 5 SDK on devices that have not upgraded to iOS 5. Where is the documentation that tells me what SDK features require iOS 5 on the device?
You should always use the newest SDK as base SDK in your application. You can always target older iOS version with the "Deployment Target" setting, but you have to pay attention which new features you can use.
For example, iOS 5 brings two interesting new features, namely ARC and storyboards. You can use ARC if your deployment target is iOS >= 4.0, with the exception of weak references, which unfortunately do not work with iOS4. Storyboards are different, they need iOS 5, they won't work at all on older devices!
If you're using the newest XCode 4, you have to do some extra work to fully support iOS 4 or older versions. This is because the armv6 code generation has been deleted from all templates. Newer devices use the armv7 instruction set, but you can compile your application so that it targets both the armv6 and armv7 instruction set. See my other post on this topic.
Generally you can build application using iOS SDK 5, which will be working on older iOS.
The build settings of every project have two different parameters, which define base SDK and iOS Deployment Target.
This first defines which SDK do you use to build your app. Second is the minimum iOS version which is required for your application.
When you build this application, you should pay attention to not use any function / object which are newer then your deployment target, because compilator and linker can allow to use it, and application will crash on devices.
Of course Apple Docs always contains information about minimum iOS version, which is required by an object. Every new version always contains change log, containing changes from previous version.
Examples:
Description of iOS 5 SDK
iOS 5 Release Notes

How to support different iOS SDKs on Xcode 4.2?

After installing Xcode 4.2 there is only iOS 5.0 SDK in Xcode.
Also I should support iPhone 3G with iOS 4.2.1.
How support two or more SDKs for one App with one Xcode?
I tried install Xcode 3 with iOS SDK 4.3 but Xcode crashes when starting.
Set the deployment target of the App to iOS 4.2.1, this will allow all iOS devices running 4.2.1 or upwards to run your App, however, you won't get any compiler warnings if you use stuff from eg. 5.0, so double check your code and add branches if needed.
Another thing is that since Xcode 4.2, the compiler only generates armv7 code, but since you also want support for the iPhone 3G, you have to manually tell it to also generate armv6 code by selecting your target, switching to the Build Settings Tab and there adding armv6 to the Architectures list.
Latest SDK included all required features from previous SDK versions. You shouldn't worry about it. If you want to support iPhone 3G just set iOS Deployment Target to iOS 4.2 (or another would you like) in project settings at Build Settings tab.
Don't remember to test your application on that iOS version.

Resources