xcodearchive icon indicating copy to clipboard operation
xcodearchive copied to clipboard

Force a SDK version

Open gcerquant opened this issue 13 years ago • 3 comments

Be able to force the compilation with a SDK version.

gcerquant avatar Dec 28 '11 12:12 gcerquant

Run a script below to choose an SDK before running the one in the repo : sudo xcode-select -switch <Path to the xCode installation>

For example, sudo xcode-select -switch /Developer ## legacy xCode sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer ## xCode 4.3 and up

dodikk avatar Mar 16 '12 09:03 dodikk

If the suggestion above does not help - please specify your understanding of the "SDK version" term.

dodikk avatar Mar 16 '12 10:03 dodikk

It can be useful to force the SDK used for the compilation, without changing your project settings.

For example, when you compile a project that supports iOS 5.0 and 4.0, to ship your app, you should compile it with 5.0.
But to make sure you do not use any API newly introduced in 5.0 (which will make devices still in 4.0 crash at runtime), you want to check the project compiles against the 4.0 SDK.

With xcodebuild -showsdks, you can see a list of installed SDKs. With -sdk, you can ask xcodebuild to compile the project against a given SDKs.

gcerquant avatar Mar 16 '12 14:03 gcerquant