Xcode Command Line Tools Installation Guide
In order to install Qt and QtCreator, you must first have Xcode Command Line Tools (henceforth shortened to CLT) installed locally.
In this document, we'll provide two ways to ensure you have Xcode CLT installed. For each option, we'll walk you through two methods.
What Is Xcode CLT?
For context, Xcode is a complete development environment provided by Apple. If you are developing applications for MacOS, iOS, watchOS and tvOS, you must install the full Xcode application.
However, for our purposes in CS 1230, you do not actually need to install the full Xcode application (which can be ~20GB or more!). If you're short on disk space, you may instead opt to install a much smaller subset of it. Specifically, the component you'll want is called Xcode Command Line Tools.
Alas, installing just Xcode CLT can be a bit troublesome.
Option 1: Install The Full Xcode Application (Simplest Way; Recommended)
Method 1: Use The App Store
If you have time, space on disk, and want the simplest solution, you can download the entire Xcode application from the App Store. This is by far the easiest approach, but it can take anywhere from minutes to hours, depending on your device and network connection.
We strongly recommend attempting this method first. This works perfectly fine for a majority of students.
After you have the full Xcode application installed, you must launch Xcode once. Please see the instructions below!
Method 2: Manual Install
Another method is to download and unpack the Xcode package manually from this website. It will be much quicker compared to a direct install through the App Store.
- Go to the website and log in with your AppleID.
- Select the latest non-beta Xcode release. You can find out what the latest version is by looking at the Xcode application listing on the App Store.
- Download the
xippackage and unpack it locally. There will be a Xcode application after you unpack the package. Move the Xcode package to the
After you have the full Xcode application installed, you must launch Xcode once.
If this is your first time installing Xcode, you should see a prompt asking you to agree to Xcode user agreement. You may also be asked to enter your password.
After entering your password, you should see the following window, wait for the progress bar to complete.
To verify that you've installed Xcode CLT correctly, run the following command in your Terminal application:
You should see the following output:
Option 2: Install Xcode CLT Via Terminal
Normally, this would be the recommended approach, because it takes so much less time and disk space. However, the Xcode CLT installed using this approach is installed to a different location, and the Qt installer seems to have issues detecting this.
While installing Qt through the graphical installer (see lab 1), a pop-up may appear saying:
Xcode Command Line Tools not installed. You should be able to dismiss the alert and continue the install process. Some of our TAs have confirmed that this is not a blocking alert, and it will disappear after you dismiss it. Subsequently, we were also able to build our assignments without issue.
However, we cannot guarantee that there won't be any unforeseen errors, as the number of samples we have is too small. We recommend that you avoid this approach, unless you are really short on disk space.
Method 1: Directly Install Xcode CLT Via Terminal
Launch the Terminal application and type the following command.
You will see the following prompt, select
Install and the installation process will begin.
When completed, you can verify the installation was successful by running the command
xcode-select -p. The output should be
Method 2: Install the Xcode Command Line Tools using Homebrew
Please refer to this website if you choose to go with this approach.