Wilson Mar bio photo

Wilson Mar

Hello. Hire me!

Email me Calendar Skype call 310 320-7878

LinkedIn Twitter Gitter Instagram Youtube

Github Stackoverflow Pinterest

The XCode IDE is a pre-requisite for Homebrew, Python, and other development tools

US (English)   Español (Spanish)   Français (French)   Deutsch (German)   Italiano   Português   Cyrillic Russian   中文 (简体) Chinese (Simplified)   日本語 Japanese   한국어 Korean


This tutorial describes the installation and usage of Apple’s XCode set of utilities for macOS developers.

XCode is Apple’s free app for developing custom programs for all Apple devices (macOS, iPhone, iPad, Apple Watch).

Since the Apple Store only handles individual .app files, other mechanisms are needed to install additional programs needed as a pre-requisite by Homebrew, Python, and other development programs.

About XCode

PROTIP: Skip Apple’s websites and App. Click here for install instructions.

Otherwise, read on for a run-around.

  1. Use an internet browser to XCode’s marketing page at:


    Xcode “includes everything you need to create amazing apps for all Apple platforms. Now Xcode and Instruments look great in the new Dark Mode on macOS Mojave. The source code editor lets you transform or refactor code more easily, see source control changes alongside the related line, and quickly get details on upstream code differences. You can build your own instrument with custom visualization and data analysis. Swift compiles software more quickly, helps you deliver faster apps, and generates even smaller binaries. Test suites complete many times faster, working with a team is simpler and more secure, and much more.”.

    BTW the “Apple platforms” include MacOS, iPhone, iPad, Apple TV, and Apple Watch.

XCode does not come with macOS because of its large size and because many users of macOS don’t need it to do software development.

Developers who use another IDE (such as Visual Studio, Eclipse, etc.) would only need to install XCode’s command line utilities for the GCC compiler Python needs to build code.

PROTIP: Newer versions of XCode installer also installs a Git client.

Overlapping installers

Imagine a Venn diagram of overlapping circles:

  1. The XCode IDE, which can be installed on a Terminal command line interface (CLI) or downloaded as a package from the App Store.

Either way, XCode contains:

  1. Command Line Utilities which can be installed separately on a Terminal command line session.

PROTIP: XCode cannot be installed if Command Utilities has already been installed. However, you can select:

sudo xcode-select --switch path/to/Xcode.app

So choose which one you want installed.

What Has Been Installed?

  1. In a Terminal window, find out what has been installed:

    xcode-select -p

    That’s the same command as:

    xcode-select --print-path

    If the xcode-select command is not found, choose to either install Command Line Tools or install the full XCode IDE.

    You have Command Line Tools installed and not the full XCode if you see the path where CommandLineTools are installed:


    If all you need is Command Line Tools, you’re good to go.

    Alternately, if the full XCode was installed, you would instead see:

  2. Get a list of its folders if XCode IDE was installed:

    ls /Applications/Xcode.app

    The response would be:

    Applications Library      Makefiles    Platforms    Toolchains   Tools        usr
    xcode-select --install
  3. PROTIP: If you want the full XCode IDE when you have the Command Line Tools installed, first uninstall Command Line Tools, then install the full XCode IDE.

    More version information

    XCode Version

  4. From within a Terminal, type:

    /usr/bin/xcodebuild -version

    If Command Line Tools was installed, you would see:

    xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

    If XCode is installed, you would get a version code that should match up with the Build Number on the Apple web page:

    Xcode 10.2.1
    Build version 10E1001
  5. For a more precise version number and other info (macOS Mavericks version and up):

    pkgutil --pkg-info=com.apple.pkg.CLTools_Executables

    A sample response, at time of writing:

    package-id: com.apple.pkg.CLTools_Executables
    volume: /
    location: /
    install-time: 1590584803
    groups: com.apple.FindSystemFiles.pkg-group

    The previous command was constructed based on a search of tools package names:

    pkgutil --pkgs | grep -i tools

    The response:

  6. Get the version of GCC installed:

    gcc --version

    If XCode was installed, you would see (at time of writing):

    Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
    Apple LLVM version 10.0.1 (clang-1001.0.46.4)
    Target: x86_64-apple-darwin18.5.0
    Thread model: posix
    InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

    If Command Line Utilities is installed, you would see (at time of writing):

    Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
    Apple clang version 11.0.3 (clang-1103.0.32.62)
    Target: x86_64-apple-darwin19.4.0
    Thread model: posix
    InstalledDir: /Library/Developer/CommandLineTools/usr/bin
  7. Identify the path where the make utility Java uses:

    xcrun --find gcc

    If XCode is installed, the response is:


    If Command Line Utilities is installed, the response is:


    Swift version

  8. Get the version of the Swift program used to develop iOS mobile apps:

    swift -version

    Sample response at time of this writing:

    Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
    Target: x86_64-apple-darwin19.4.0

    The above appears regardless of whether Command Line Utilities or XCode is installed.

    From here, uninstall and install Command Line Tools or install the full XCode IDE.

    UnInstall Command Line Tools

    PROTIP: This is also how you upgrade Command Line Tools.

  9. Go to the parent folder where Command Line Tools is installed:

    cd /Library/Developer 
  10. Get a list of its folders:

    ls CommandLineTools

    If Command Line Tools were installed, the response would be :

    Library	SDKs	usr
  11. Remove all files in that folder, which requires a password for elevated permissions to get all the files:

    sudo rm -rf /Library/Developer/CommandLineTools

    The response is a lot of files removed (to the Trash).

    Now you can choose to either install Command Line Tools or install the full XCode IDE.

    Install Command Line Utilities only

    See https://developer.apple.com/library/archive/technotes/tn2339/_index.html and http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x

  12. To install the whole XCode IDE:

    xcode-select --install

    You should see this pop up:


  13. Manually click “Install”, “Agree”, then “Install” to the “Updates Available” pop-up.

    NOTE: The download takes 13 minutes on a 10mbps line.

  14. When you see “The software was installed.”, click “Done” to dismiss the pop-up.

XCode IDE install from Terminal

PROTIP: Either way, if you have Command Utilities already installed, you must first delete it.

  1. In Finder, look for XCode.app in the /Applications folder.

  2. Alternately, on the Touchpad pinch 4 fingers together to click the App Store. Type enough of “XCode” to filter out others. Then double-click on the XCode.app to run it.

  3. To view the version, cursor to the top of the screen and click the program name next to the Apple icon to select “About XCode”:

    xcode about 271x48

    Read the XCode IDE’s ratings

  4. In an internet browser, get to the “Mac App Store Preview” at

  5. Click View in Mac App Store, then “Open App Store.app” in the pop-up.
  6. Provide your Apple ID and password. Get one if you don’t already have one.

    Don’t click the blue “OPEN” icon at the upper-right to open the app if the app was installed.

  7. Scroll down to click See All on the right edge.
  8. Click “Sort by Most Recent”.
  9. Read through the Ratings to decide for yourself.
  10. Click the red dot at the upper-right to dismiss the dialog.

    Close all other applications open.

  11. Press command+Tab until the application you want to close next is highlighted.
  12. Press command+Q to close it.
  13. If a file needs to be saved, do that.

A) Initial install from Terminal CLI

  1. Open a Terminal.app console window at any directory to install -all the latest XCode from Apple:

    softwareupdate --install -a

    The response on Catalina version of macOS:

    Software Update Tool
    Finding available software
    Downloaded macOS Catalina 10.15.5 Update
    Installing macOS Catalina 10.15.5 Update
    To install these updates, your computer must shut down. Your computer will automatically start up to finish installation.
    Installation will not complete successfully if you choose to restart your computer instead of shutting down.
    Please call halt(8) or select Shut Down from the Apple menu. To automate the shutdown process with softwareupdate(8), use --restart.
  2. Click the Apple icon at the upper-right corner and select “Shut Down…”.

    After starting again

  3. Set Apple’s licensing agreement bit:

    sudo xcodebuild -license
  4. Manually agree to the terms.

  5. Get the version number of the new version.

B) Initial IDE install using web App Store

  1. In an internet browser, https://developer.apple.com/download

  2. Sign in to Apple Developer with your email address then click the arrow icon. Enter your password, then click the arrow icon.

    Below is the “Software Update” approach:

  3. You’ll need to establish an Apple ID if you haven’t already.

  4. Click Download and provide your Apple ID.

  5. Go through Apple’s location verification if prompted.


  6. Click “Allow” to the pop-up “Do you want to download?”.

    XCode size

  7. CAUTION: Make sure that your machine has enough free space available.

    These are massive files that may take a while to download if you don’t have a fast internet connection.

    NOTE: Each version of XCode is related to a specific version of the Apple OS Mac operating system.

    File Date Download Unpacked
    XCode_11.5 2020-06-01 7.5 GB ? GB
    XCode_10.2.1 2019-04-17 ? GB 6.1 GB
    XCode_9.0 2017-09-19 . ? GB ? GB
    XCode_8.2.1 8C1002 2016-12-19 ? GB ? GB
    XCode_8_beta_2.xip 2016-07-05 5.9 GB 12.32 GB
    XCode_7.31 2016-05-03 3.8 GB ?
    XCode_4.1 2014- 2.9 GB ?
    XCode_3.2.4 2014- 2.? GB ?
  8. Switch to Finder Downloads folder to watch progress on the file name ending with “Download”. The one with a clock icon which signifies downloading.

  9. Return to the versions instructions above to view the updated version.

  10. Delete the installer after you’re done, to reclaim disk space.

XCode IDE Upgrade

Over time, Apple updates XCode and its command line utilities.

  1. Click the Apple icon, then click System Preferences. Here is an example notification:


  2. Search for “Software Updates” or click the icon.
  3. Click “Update Now” if that appears. (but first do a backup.)
  4. Click “Agree” to the EULA.
  5. When done, view the version numbers installed.

XCode FileMerge tool

  1. Open XCode.

  2. Right-click on XCode icon. Select “Open Developer Tool”. Select “FileMerge”.

  3. Specify one file to compare.

  4. Specify the other file to compare.

  5. Click “Compare”.

    Configure git to use FileMerge.


More on OSX

This is one of a series on Mac OSX: