Invoke a different version of Xcode via xcodebuild from a Run Script Phase
Invoke a different version of Xcode via xcodebuild from a Run Script Phase
- Subject: Invoke a different version of Xcode via xcodebuild from a Run Script Phase
- From: Dan Korn <email@hidden>
- Date: Mon, 14 Apr 2014 10:08:48 -0700
- Acceptlanguage: en-US
- Thread-topic: Invoke a different version of Xcode via xcodebuild from a Run Script Phase
Due to requirements of third-party SDKs (specifically the Adobe InDesign SDK) outside of my control, building the entirety of our product suite requires components to be built in different versions of Xcode. We try to automate our build process so that a human is be able to check out the code and perform as few manual steps as possible to build the entire product suite.
What I’m trying to do is, from a Run Script phase in a project in one version of Xcode, call xcodebuild to build components in the other version of Xcode. But it’s not working. It always tries to build the project specified in the xcodebuild command in the current version of Xcode.
From the Terminal, I can use sudo xcode-select -switch to point xcodebuild to whichever version of Xcode I want. But, when I call xcodebuild from a script in Xcode, xcodebuild seems to ignore the xcode-select setting completely, and tries to build using the same version of Xcode. Calling xcode-select -print-path from the Terminal and from the script called from Xcode confirms this, as each prints a different path.
Even if I were to write a script to do the entire build, it would need to invoke xcodebuild for multiple versions of Xcode, which, as far as I know, is impossible to automate, as xcode-select -switch must be run as root with sudo.
(FWIW, we do something similar on Windows, using environment variables such as %VS100COMTOOLS% and vsvars32.bat to invoke devenv /build to build Visual Studio solutions from different VS versions.)
So how can I invoke a build in a *different* version of Xcode from a Run Script phase? Is this simply not possible?
Thanks,
Dan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden