Xcode IOS Deployment target Options - ios

In Xcode there are 5 columns when entering the Deployment target like shown below.
Resolved / AppName / Config (Pods) / App Name/ IOS Default
What are all these columns/options for? Is there not just one IOS Deployment Target for the app.
I understand that because I use Cocoa pods there could be a separate deployment type for the pods, but why the two columns with app name and ios default etc?

Each of the columns is a different place in the build system "hierarchy" where the value can come from. The rightmost is the default built into Xcode; moving from right to left, there's the overall project, the config file from Cocoapods, the per-target config, and the value that will actually take effect. If your project is part of a workspace, there's a level there, too.
You're right that for an app, there can be only one deployment target. But you can have more than one app in a project, and could have different deployment targets for each. Say you have the older version of your app that works all the way back to iOS 4.3, and a newer version that only works in iOS 7 and later. You could have them both be part of the same project in Xcode and use a different deployment target for each.

Related

KMM - How to set iOS deployment target?

I am trying to initialize a KMM project. On the initialization page it asks for minSdk version for Android but not for iOS.
The only way I could find was to traverse the files and manually change iOS deployment target in all of them. I even opened the project in XCode and changed the deployment target in XCode but it did not affect anything either.
Is there any proper workaround or official solution to change iOS deployment target?
No need to manually change XCode project files, you should:
Open iOS project in XCode
Select project file
Go to Build Settings
Search for ios deployment
Change iOS deployment target
Commit changes they will be in iosApp/iosApp.xcodeproj/project.pbxproj if you are using standard KMM template

Invalid deployment target of the framework

I want to decrease the framework deployment target from iOS 10 to iOS 9. I did the fork of the library, changed deployment target of the framework TARGET (not whole project). When I build the dependency I can see in info.plist that deployment target is iOS 9 (screenshots attached) in the framework and iOS 8 in the framework's dependency. Anyway, my project where I attach those still outputs that iOS 10 is required for this framework (yes, i did clean, delete derived data, change simulator, reset xcode).
.../MyFile.swift:13:8: Module file's minimum deployment target is ios10.0 v10.0:
.../MapFramework.framework/Modules/MapFramework.swiftmodule/arm64.swiftmodule
(that's in Swift file in the line where I have import MapFramework)
The issue was happening, because by mistake, there were two copies of the same .framework in the file hierarchy. One was in Carthage folder, another one in root folder. Even though marking in Xcode -> Reveal in Finder on the framework it always shown framework in Carthage folder, somehow it was processing both of these. After removal of the framework located in root folder everything was working perfectly fine (I didn't have to change any paths or references in Xcode, what shows that Xcode all of the time was pointing to the correct version).
Seems like an Xcode bug.

What does deployment target mean?

this is a very simple question I'm assuming. Can someone tell me what deployment target means. If I choose IOS 10, does that mean only users with iOS 10 can download the app. Is it bad to choose a lower deployment target? ALSO, continuing on deployment target, is it not recommended to run on a lower deployment target.
Lets say you have set minimum deployment target to iOS 9.
This means your application is compatible for iOS 9 and above devices.
The application won't run on below 9.0 devices but can run on any iOS version greater than iOS 9.0.
The deployment target determines your app's ability to run on older iOS versions.
App with deployment target set to 10 will work on iOS version 10+ (10, 11, 12, 13 ...) but won't work on 9.x.
When a new version of iOS is released, some people do not bother to update their devices to the latest iOS version and thus they can't download your app from the App Store.
Example
If you choose higher deployment target (e.g 12.1), your app won't be able to download for the people who even have latest devices but have older iOS version (iPhone X with 11.0). In Contrast If you choose lowest possible deployment target (e.g 6.0), you try to make your app maximum backward compatible (so even if someone hasn't updated their iOS in ages will be able to download your app).
CAUTION
Many (almost all) newer frameworks and features won't be able to run properly (Behave as expected) on lower iOS versions which increases the chances of app crashes.
What Affects Deployment Target
Following are few factors that demands higher deployment target.
1) Using latest iOS SDK (alone)
2) Using latest iOS SDK specific features (Constraints, newer XIB files etc).
3) Using fast adapting external libraries / Frameworks (e.g Facebook SDK, Firebase etc).
4) Higher Swift Version (5.0) requires higher deployment target vs writing your app in legacy Objective C) !Needs citation.
SOLUTION
We have been using Deploymate for maximum backward support. It mainly assists us about warning the following:
1) Newer APIs that won't work on lower iOS versions
2) Using deprecated methods that won't work on newer iOS versions.
This is when you start fixing your code to make it available for lower iOS versions for maximum compatibility.
Note: Xcode also informs about several pitfalls. Deploymate is neither associates with us or pay us in any form. You can look for other alternates.
iOS Deployment Target(IPHONEOS_DEPLOYMENT_TARGET)
Deployment Target is a minimum version of iOS which is supported by your target.
It means that:
as a developer you support this version and you are able to support all next compatibility
as a user you should have at least this version of iOS
To change it in Xcode 11.5
Build Settings -> iOS Deployment Target
//.pbxproj
IPHONEOS_DEPLOYMENT_TARGET
If you are new to Xcode, I suggest accepting the default, and thinking of it as a constraint on your project.
As newer of Xcode versions come along, support for older target values will be removed. Companies that have extensive customer bases have to deal with this problem in their own way.
In most projects I have worked on, the iOS version matters because it dictates which devices can run your application.
For example, iOS 10 essentially left behind all iPod-style connectors.

How to link and unlink frameworks depending on Deployment in iOS

i want to know how to link frameworks and unlink automatically depending on deployment target.
For example Digits and Twitter Core frameworks are for minimum deployment target iOS 8.0 so i want to link these frameworks when app is running on iOS 8 and higher and when running on iOS 7 i do not want to link.
i also checked setting the Framework options in Build Phases to Optional but its did not work.
How i can specify these frameworks in Bridging Header file so that depending on Deployment that will be linked and unlinked automatically.
You have to create different build targets based on you requirement. While releasing the app to app store you have to release different application which is built with corresponding target. Yo can't unlink on runtime

Xcode iOS Base SDK Missing

I have an old iOS app that I never distributed and am now trying to work on the project again. It worked fine with an earlier version of Xcode but I was not ready to deploy it at that time. Now I am using the current version of Xcode but I have an error that there is a missing base SDK. I have explored every posting here with that error message and they did not work for me.
On investigation in Xcode. I can choose my app under "Project" pane. With the Info tab chosen, it has under Deployment Target as "Mac OS X Deployment Target" and Default in the drop list.
This is an iOS app and not a Mac OS X app. How do I change this?
I already have the base SDK as the Latest iOS.
Suggestions?
Try this:
Open Xcode and Press cmd + 1
In left panel choose your project -> Your target in center panel-> Build Settings in right panel
Find "Base SDK" and choose "Latest iOS". If you see a Release and Debug lines, then choose this for both Release and Debug.
Restart your Xcode
Usually when you see this, it's when you've got an old iOS project and you're using a version of Xcode that uses a newer base iOS. In those cases, you can click on the target on the top of the tree structure of the Project Navigator on the left, and you'll see the project settings. There's a button labelled "Validate Settings" and will show up near the lower center portion of the main panel. Click on it.
If that doesn't do it (e.g. it's from a really old version and Xcode can't figure out how to remedy it), it might be easier to recreate the project. Create a new iOS project and then copy your source code, its NIBs and resources into that project. Maybe that will be easier than trying to fix the old project you have.

Resources