xcodearchive
xcodearchive copied to clipboard
Force a SDK version
Be able to force the compilation with a SDK version.
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
If the suggestion above does not help - please specify your understanding of the "SDK version" term.
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.