Difference between iOS SDK and simulator - ios

I'm targeting iOS 5.1 with my app. I am running against the iPhone 5.1 Simulator, but I have noticed my project is listed as 1 target, iOS SDK 6.0.
The deployment target is listed as 5.1.
What is the difference between the SDK and simulator target? Should I be using a 5.1 SDK and if so how would I do this?

The SDK represents the API that you can use. The deployment target is the lowest version number that you're certifying that it will run on.
If the SDK and deployment target differ then you need to be careful that you don't use any APIs that are not available on older versions (or you disable that functionality if it's not there).

Related

Does user's iOS version limit their ability to install an app from the app store, is there a way to make it universal? [duplicate]

I wanted to ask how compatibility on different iOS operation systems works in iOS. For example If I develop an app on Xcode 9.2 and Swift 4 for iOS 11, should it work on iOS 9?
I am coming from Android background which you specify the minimum Android OS that is needed for the app to run in the Gradle file. Does anything similar exist on iOS?
Very simple solution:
Set deployment target as 9.0 in your build target general settings. iOS will automatically handle support from 9.0 onwards for a build (your app).
Your app/build will be allowed to use/import frameworks and other libraries, compatible to minimum deployment target, only.
More detail about App Deployment Target from Apple.
Please set your deployment target to 9.0
Yes, it will work on iOS9
With Xcode 9.2 and swift4 you can develop an application for ios8.0 and above.
In your project setting, you have to select your development target
Yes, there is backward compatibility, but for older iOSes you have to check version when using newer API. Luckily we've got availability attributes (#available)
If you want to know HOW it works, basically for Swift your application has its own swift standard library embedded into binary of your application. In case of Objective C – newer iOSes keep sdk's of older versions to maintain backward compatibility.

How do I set a previous base SDK in Xcode 10?

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:

iOS Compatibility on different iOS Operation Systems

I wanted to ask how compatibility on different iOS operation systems works in iOS. For example If I develop an app on Xcode 9.2 and Swift 4 for iOS 11, should it work on iOS 9?
I am coming from Android background which you specify the minimum Android OS that is needed for the app to run in the Gradle file. Does anything similar exist on iOS?
Very simple solution:
Set deployment target as 9.0 in your build target general settings. iOS will automatically handle support from 9.0 onwards for a build (your app).
Your app/build will be allowed to use/import frameworks and other libraries, compatible to minimum deployment target, only.
More detail about App Deployment Target from Apple.
Please set your deployment target to 9.0
Yes, it will work on iOS9
With Xcode 9.2 and swift4 you can develop an application for ios8.0 and above.
In your project setting, you have to select your development target
Yes, there is backward compatibility, but for older iOSes you have to check version when using newer API. Luckily we've got availability attributes (#available)
If you want to know HOW it works, basically for Swift your application has its own swift standard library embedded into binary of your application. In case of Objective C – newer iOSes keep sdk's of older versions to maintain backward compatibility.

iOS 6.1 compatibility

I have a iOS 7.0 app, I need it run perfectly on iOS 6.1. I have download the iOS 6.1 simulator, and I have the iOS 7.0 sdk as the base sdk. If I want my app to run perfectly both on iOS 7.0 and iOS 6.1 do I have to set the base sdk as 6.1? or keep iOS 7.0 as the base sdk and just run this app using iOS 6.1 simulator. I know I should the set the deployment target as iOS 6.1 so It can work on iOS 6.1. I just don't know how to set the base sdk. Can anybody explain me the base sdk and deployment target?
The base SDK defines which functionality you can use in your apps. As of today 2014-03-31, you can't submit applications that have a Base SDK set to iOS 6 anymore. You need to compile your apps with the 7.0 base SDK.
The deployment target describes the lowest iOS version your app will run on, so in your case it's 6.0.
If you're using iOS 7-only features, you'll have to implement runtime checks, largely based on -respondsToSelector:. That'll allow you to gracefully degrade on old versions.
Set the base SDK to be always the latest, be it 7.0 or 7.1. Your app is compiled using that sdk and therefore newer SDK compatibility and functions are applied to your project.
setting Min Deployment target allows compiler to check for API methods compatibility with that OS version in mind.
Hope it clears up your doubts.

iPhone SDK deployment target on Xcode

I'm hesitant about Deployment target in xCode.
my question : can my application run on iOS 3, 4, 5, 6 if I select on Deployment target 4.3 ?
I can't test my application on an iPhone because I don't have it but I think the application can only run on IOS 4.3 or later
sorry for my bad english
If you use iOS 4.3 as deployment target, that will be the minimum version supported by your app. So, no, it won't run in iOS 3.0 for instance.
Also, you'll need to detect features not present in the iOS actually running the app and program them conditionally.
I'd suggest supporting iOS 5 or better. And definitely forgetting about iOS 3.
That is correct. The Deployment Target is the earliest version of iOS that your application will support.
Note, however, that if you use an API call from your current SDK (4.3) that is not present in the 3.0 SDK, your application will crash on devices running iOS 3.0.
So even though you can set the Deployment Target to 3.0, that will not guarantee that your app will work on an iOS 3 device.
See the Apple Developer documentation for more details.

Resources