Xcode is the development and debug environment that provides the required development files for Mac OS X and iOS applications. By installing the Developer command line tools you’ll get the macOS SDK, headers, and build tools such as the Apple LLVM compiler and Make. As a developer for Mac OS X and iOS applications, these tools make it easy to install open source software or develop applications on UNIX within Terminal.

In this article we show macOS users how to install XCode Command Line Tools from the terminal. To get started launch your terminal and run the following commands to install XCode Command Line Tools on macOS Big Sur:

xcode-select --install
sleep 1
osascript <<EOD
  tell application "System Events"
    tell process "Install Command Line Developer Tools"
      keystroke return
      click button "Agree" of window "License Agreement"
    end tell
  end tell

If you’re asked for password input user’s password to escalate privileges as required.

Select “Install” to begin installation of XCode Command Line Tools on macOS Big Sur:

If additional tools need to be installed accept the prompts give to proceed.

Then wait for the downloading and installation of XCode Command Line Tools on macOS Big Sur to complete.

Confirm if the installation was successful by running the following command:

$ xcode-select -p

This will print the Command Line tools directory.

You can also verify by checking the version of CLT:

$ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
volume: /
location: /
install-time: 1618128009
groups: com.apple.FindSystemFiles.pkg-group

Checking xcode-select version:

$ xcode-select --version
xcode-select version 2384.

Running brew config should also show the version of Xcode CLT version:

$ brew config
ORIGIN: https://github.com/Homebrew/brew
HEAD: 8e11f03fa93b148e26044a331654241a2c307039
Last commit: 6 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 1893119f1eb7b31ce64a1fe63376c806c98068ab
Core tap last commit: 5 hours ago
Core tap branch: master
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.wMECub83rA/org.macosforge.xquartz:0
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: 16-core 64-bit kabylake
Clang: 12.0 build 1200
Git: 2.24.3 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 11.2.3-x86_64
Xcode: 12.4
XQuartz: 2.7.11 => /opt/X11

I hope this guide helped you to install XCode Command Line Tools on macOS Big Sur. You can also explore more articles we’ve on macOS:

Analyze and Clean Your macOS using Clean Me

Install and Use LuLu free macOS firewall

How To Install PowerShell on macOS