There are no standard paths to keep different copies of XCode (XCode3 and XCode4) on one system. For my Makefile or other commandline based build process, I am searching for a way to determine to installation path ($DEVELOPER_DIR) of XCode of a specific version, to export this path as DEVELOPER_DIR or use xcode-select to make it active.
So far I am trying to query system_profiler's xml output.
Are there any other (more convenient) options?
Basically I need a script to tell the system to use Xcode3 (or Xcode4) without knowing their installation paths.
Here's what I have come up with so far:
DEVELOPER_DIR=`system_profiler SPDeveloperToolsDataType -xml |\
xpath "//*[text()='spdevtools_version']/following-sibling::string[starts-with(text(),'3')]/../*[text()='spdevtools_path']/following-sibling::string[1]/text()"`
This sets DEVELOPER_DIR to the installation path of Xcode3. For Xcode4 just replace the '3' by '4'
This will not work as expected when multiple versions of XCode3 are installed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With