Minimum Deployment vs Target Deployment
Asked Answered
K

2

11

What is the main difference between the term minimum deployment and target deployment in Xcode?

I notice that I have to set up these two target versions, but I am not sure whether these two are different or same stuff just different words?

Kuopio answered 8/11, 2022 at 18:10 Comment(0)
A
11

The Target Deployment you are referring to is in the "Project" section. This specifies the default Minimum Deployment for targets created as part of this project.
The Minimum Deployment is set per target and specifies the minimum OS version this particular target will support.

Alburnum answered 8/11, 2022 at 18:25 Comment(4)
But why when I set deployment target to iOS 16, with minimum deployments iOS 15, I still can compile?Kuopio
That is because minimum deployment is the actual iOS SDK you are compiling against. Target Deployment is only used when you don't specify minimum deployment in your target or create a brand new target in your project.Arroyo
Confusing when you only have 1 target but I guess the project could have a deployment target of 16 which new targets will get but an existing target could be set to 15. Or, even more confusing, an existing target is set to 16 and you change your project target to 15 and wonder why the target still compiles.Xerophilous
I'm not sure if the Project level has actually any actual use anymore, because the targets seem to be set explicitly, but I still use it as shorthand in the project so I can remember what version dependencies the project might have.Ochlophobia
B
0

Since individual targets' version can always overwrite the project's version, behaviors are like the following.

  • In the past, the project "iOS Deployment Target" and the target's "Minimum Deployments" are represented by 4 different IPHONEOS_DEPLOYMENT_TARGET values, 2 for each debug/release pairs.

  • Starting from some time around Xcode 15 (objectVersion = 60), the behavior seems to have changed slightly in Xcode project file.

    • If you set the project "iOS Deployment Target" to a version >= the "Minimum Deployments" for a target, then the target will automatically be bumped up to the same version, hence 2 values in the project file; if you set the "Minimum Deployments" for a target to a version greater than the project "iOS Deployment Target", then there will be 4 values in the project file.

e.g.

"iOS Deployment Target" = iOS 15.1, "Minimum Deployments" = 15.0
will be automatically changed to
"iOS Deployment Target" = iOS 15.1, "Minimum Deployments" = 15.1
and there are 2 IPHONEOS_DEPLOYMENT_TARGET in the project file.

"iOS Deployment Target" = iOS 15.0, "Minimum Deployments" = 15.1
will stay the same
and there are 4 IPHONEOS_DEPLOYMENT_TARGET in the project file.

In case you want to make it 2 entries in the project file, simply tap backspace on the target "Minimum Deployments" (if it doesn't involve multiplatform), just like resetting to default in the build settings.

related posts:

Bacon answered 4/4 at 20:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.