5

I have a Macbook pro running OS Mojave with Xcode 10.1 and the command line tools are installed at /Application/Xcode.app/Contents/Developer. For a project that I have xcodebuild is invoked from the command line.

I desire to run a static analysis tool against the project (the tool invokes xcodebuild) that doesn't support Xcode 10.1 or the Swift and Clang compiler versions shipped with it. The tool currently only supports Xcode 9.2. I downloaded Xcode 9.2, extracted and renamed Xcode.app to Xcode9_2.app and moved it to my Applications folder.

I'm assuming xcodebuild is installed as part of the command line utilities install and that I need to install the command line utilities for Xcode 9.2. However when I try to install them I get a message "Command Line Tools (macOS High Sierra version 10.13) can't be installed on this disk. The version of macOS is too new." I also have a concern that the older Xcodebuild could replace the newer one since it is living in /usr/bin.

The invocation of xcodebuild looks like this:

xcodebuild -workspace ‘MyApp/MyApp.xcworkspace' -scheme ‘MyApp’ -configuration 'Release' -archivePath MyApp.xcarchive archive

So my question are:

1) Is xcodebuild part of the command line tools?

2) If it is how do I install various versions of the command line tools? I'm assuming once they are installed that I can choose with something like:

sudo xcode-select -s /Applications/Xcode9_2.app/Contents/Developer

But again I'm seeing a message preventing installing the Xcode 9.2 command line tools.

I've also seen this other SO post but I don't think the remove quarantine step is applicable and I don't think it addresses the issue that xcodebuild lives in \usr\bin. Also I tried renaming Xcode.app that is version 10.1 then renaming Xcode9_2.app to Xcode.app and running in terminal xcode-select --install but it simply says "command line tools are already installed..."

bhartsb
  • 1,316
  • 14
  • 39

0 Answers0