I am building an IOS app on XCode 11.3.1 using Swift and would like to know which Iphone models will be compatible with the app. The simulator shows Iphone 8 and above. Does it mean that lower Iphones will not be able to run it?
I can't find a good explanation or a link.
The Xcode version is not the key to supporting older iPhones and their OSes.
Instead, look out for your deployment target. The lower you choose, the more ‘old’ iPhones you get. For example, if you choose iOS 8 as your deployment target, your app will support older devices that can use iOS 8 but not 13.
The simulator only shows a list of devices that supports the newest iOS version supported by the current version of Xcode, but may not necessarily mean that it is limited to those.
Do note that newer APIs be used for the older devices, though you could still make it such that it will work for newer devices, with a fallback to some older APIs just for the older devices.
Related
In earlier versions of Xcode I could set the base SDK to the current iOS version and the deployment target to an earlier version as shown in the below slide from the iOS 7 TechTalk, session Architecting Modern Apps, Part 2:
This Stack Overflow question elaborates nicely on the Base SDK vs Deployment target.
What's the meaning of Base SDK, iOS deployment target, Target, and Project in xcode
However, now when I look at the base SDK config field in Xcode I just see "iOS" (which is an alias of "iphoneos").
According to https://developer.apple.com/ios/submit/
Starting March 2019, all iOS apps submitted to the App Store will need
to be built with the iOS 12.1 SDK or later, and support the all-screen
design of iPhone XS Max or the 12.9-inch iPad Pro (3rd generation).
This worries me because it seems that I can no longer target older versions of iOS.
I've done a lot of research by I cannot seem to work out definitively whether there still a way to use the 12.1 SDK but target older versions of iOS. Is there a way to do this?
The base SDK is just "iOS". The exact version will depend on your version of Xcode (12.1 if you are using Xcode 10.1). The base SDK does not determine which versions of iOS are supported by your app.
You set the minimum version your app is compatible with by specifying the "iOS deployment target", either for your project as a whole:
or in the settings for a specific target in your project
The oldest version of iOS that you can target with Xcode 10 is iOS 8 (which is pretty old).
BTW, you can see or select the Base SDK you are using, in the Xcode Preferences/Locations:
I currently have XCode version 8.2.1.
On my iPhone, I currently have iOS 10.3.2.
My version of XCode will not deploy to anything over iOS 10.2.
On my iPhone, I am being offered an upgrade to iOS 11.0.3.
According to this wiki here, XCode version 9 will deploy to iOS 11.0: https://en.wikipedia.org/wiki/Xcode#9.x_series. But I can't tell whether this includes all the sub-versions, eg 11.0.3.
So my question is, if I get XCode version 9 and upgrade my phone to iOS 11.0.3, will I be able to deploy to my phone from XCode? How do I tell exactly which versions of iOS are supported by each version of XCode? And going forward, how can I ensure that my iPhone and iPad always have versions of iOS which I am able to deploy to from XCode?
Yes, you will be able to deploy to your phone.
While you need Xcode 9 and not 8 to program against iOS11, this question has more to do with the Base SDK and Deployment Target settings in your project.
The Base SDK is the SDK version you are compiling against. In Xcode 9, this could be iOS11, for example. The Deployment Target setting represents the lowest supported iOS version the app will run on. This might be iOS10, per your example, but it could be anything else.
To use the newest iOS11 features, you'd have to have a minimum Base SDK of iOS11. To support older platforms, you must make sure the Deployment Target is set to the oldest version you'd support. In code, you need to check the version of the platform when deciding to use a newer-than-Deployment-Target feature.
if I get XCode version 9 and upgrade my phone to iOS 11.0.3, will I be able to deploy to my phone from XCode?
Yes. Xcode 9 and iOS 11 are both the latest (as of Oct. 2017) versions available. If you want to support iOS 11, you need Xcode 9.
How do I tell exactly which versions of iOS are supported by each version of XCode?
Check the release notes. For example, the Xcode 9 Compatibility section says:
Xcode 9 includes SDKs for iOS 11, watchOS 4, macOS 10.13, and tvOS 11
And going forward, how can I ensure that my iPhone and iPad always have versions of iOS which I am able to deploy to from XCode?
Staying current with the latest iOS and Xcode versions is one way to do that. You don't even need the latest iOS version on your phone -- just any version that's later than the minimum version supported by whatever Xcode you're using. Looking at the list of available deployment targets, I can see that Xcode 9 deploys to iOS versions back to iOS 9.1.
Mostly, just be aware that updating iOS on your phone may require you to also update Xcode.
At a loss here. I have to test an app on iphone 4 devices as well as newer ones. Can anyone advise me as to how to set Xcode 9 up to support ios 7 as a deployment target as well as up to the newer versions of ios? So that I can use iphone 4 simulator and later test on the iphone 4 device?
Can anyone advise me as to how to set Xcode 9 up to support ios 7 as a deployment target as well as up to the newer versions of ios?
The advice is simple: You can't. (Okay, maybe you can, with some sort of elaborate hacking; but don't.)
There's no problem running multiple versions of Xcode, so use an earlier version of Xcode to test on iOS 7. This will be tricky, because your project may not be easily backward compatible from Xcode 9 to an earlier version of Xcode, but it's your best hope. (Either that, or do what Apple really wants you to do: abandon backward compatibility beyond iOS 8.)
Since iOS 9, Apple has stopped support of iPhone 4S.
To work with iPhone 4S with Xcode 9, you need to set Deployment Target for your build (TARGET) below iOS 9.0
Follow these steps to work with iPhone 4S with Xcode 9:
Select your Project (Root) >> TARGET >> Tab 'General'
Set 'Deployment Target' to 8.4
.
Now open Simulator List, You can see, iPhone-4S is there to work with it.
I suggest to work with latest stable version of iOS (iOS 10).
Using latest xcode, you do not need to worry about supporting latest iOS version even if you choose lower deployment target which determines the app's backward compatibility.
It is a good idea to support the backward compatibility as far as your code is not depending on latest APIs and frameworks. The only reason for backward compatibility is to maximize the user base as not everyone (specially elders) update their iOS version regularly.
WARNING:
If you choose lowest possible deployment target (8.0), some newer features and frameworks won't be able to behave as expected which increases the chances of app crashes in older iOS versions.
Currently, we are using Xcode 10.1. AND Xcode 10.1 supports iPhone4s.
(Please don’t confuse Xcode version (10.1) with the (iOS 10.1).
Xcode is an IDE which can have backward iOS SDK support.
The latest iOS we updated on our iPhone4s is 9.3.5
To test your code on device, you can simply connect an iPhone4s or you can download a simulator with iPhone4s support (9.0 or so)
To download additional simulators you can go to xcode > preferences > components Once the simulator is installed, the option for iPhone 4s would be available for testing.
TIP: We have been using Deploymate for maximum backward compatibility and support. It warns us about deprecated methods and this is where you start modifying your code to support the lowest iOS version with confidence.
After a recent question of mine (https://apple.stackexchange.com/q/116029/7742), here is some info:
My app was developed using Xcode 5, iOS SDK 7. Deployment target is 4.3.
I was told that the 4th generation iPod touch can't run iOS 7.
Since my app has a deployment target of 4.3, then it should run on that iPod, right? Or does the fact that I used the SDK 7 mean that it won't work?
iPod Touch, 4th Gen DOES NOT support iOS 7. See this Wikipedia article.
You CAN use Xcode 5 to build an App with a deployment target of 4.3, but that means you CANNOT use any iOS feature supported only by versions of iOS > 4.3. And you will have to be VERY CAREFUL to check that you don't, or the App WILL crash.
And... unfortunately there is no Profiler or Pre-Processor that warns... although you can double check if Xcode "Analyze" warns you. Else you just have to very carefully check all your code for conformity with the limitations of the 4.3 SDK or test a lot... well actually do both.
A deployment target means that the should work on devices running that deployment target iOS version (or later). (So, if your deployment target was 4.3 and the device is running an iOS version of 4.3 or greater, you should be fine.) The fact that you used Xcode 5 and the iOS 7 SDK will not affect this. The only limitation is that we cannot use the latest compiler to build for iOS versions prior to 4.3 and/or the first or second generation hardware.
Clearly this assumes that you didn't accidentally reference any classes or methods that require later iOS version (or if you decided to avail yourself of new features, that you put in runtime checks to only use those new methods/features if they were available). Try running your app on an iOS 6.0 simulator to confirm compatibility with iOS 6. (Note, Xcode 5 no longer includes the simulators prior to iOS 6.0, so if you really want to test against earlier versions, such as iOS 5.0 or 4.3, you might just want to get your hands on some old device with that older iOS version.)
I mention getting an older device, because compatibility with the old iOS version is not enough. You want to ensure your app can run on that hardware (e.g. doesn't require more than the 4th gen 256mb of memory, cellular, etc.). You really should find yourself physical hardware with older iOS versions upon which you can test your app.
Now, I use Xcode 4.2 supporting iOS 5.0. Apple has just released iOS 5.0.1 beta 2. I can install it on my iPhone.
I want to test with this beta version, i.e build code from Xcode.
How do I build code from Xcode 4.2 for device of iOS 5.0.1 beta?
Please help
In exactly the same way that you would do so for iOS 5.0. We can't talk about beta versions of the software, but we can talk about what happens when newer versions of iOS are released. When you connect a device with a newer version of iOS installed, the Xcode Organizer will give you a message like:
Xcode does not have debugging information for the version of iOS on the device named “Dev iPhone”. Xcode can collect debugging data from the device to enable development with this version of iOS. This process only needs to be done once per iOS version, and will take several minutes.
You simply click OK or similar, and Xcode downloads the necessary debugging data. You can then build to the device from Xcode and use all the debugging tools as usual. This process works for point releases. It is highly unlikely this would work for major updates (e.g. if iOS 6 was released) and it may or may not work for iOS 5.1, depending on the changes included. But when Apple have not released a new version of Xcode to developers, you can be sure it is because one is not required.
It is important to understand the distinction between an updated version of iOS (for the device) and the iOS SDK (for Xcode). A point release of iOS does not necessarily require any change to the iOS SDK, and therefore with Xcode's ability now to download the debugging information on demand (a feature that has been around for a while), you don't necessarily need an updated version of Xcode. Likewise, with Xcode 4.2 you still set the iOS 5.0 as your base SDK even if you are setting an earlier version (e.g. iOS 4.2) as your deployment target. You don't need the iOS SDK v4.2 to target iOS 4.2 for deployment. (Just make sure you add back "armv6" to targeted architectures in your build settings, if you still want to support the iPhone 3G and equivalent iPods, as in Xcode 4.2 this is not included by default.)