Home/Guides/Do I need to install Xcode Command Line Tools separately, and how?

Do I need to install Xcode Command Line Tools separately, and how?

Updated · airankrush

What this guide covers

When you finish, git, clang and similar tools work in Terminal, and you know whether the command line is using the standalone package or the set inside Xcode. You need: a working remote desktop connection.

Steps

  1. Decide first: with Xcode installed, you do not need a separate install

    Apple's Command Line Tools installation documentation is clear: Xcode ships with clang, xcodebuild, xcrun and other command-line tools, so once Xcode is installed there is nothing more to install separately.

    The standalone Command Line Tools package is for people who do not install full Xcode. It goes in /Library/Developer/CommandLineTools. Note that it does not include xcodebuild, so the package alone cannot build iOS apps.

  2. Method 1: trigger the install from Terminal

    xcode-select --install

    This command does not finish the install inside Terminal. It opens a system dialog where you click Install and accept the license agreement. So do it in the graphical desktop over UU Remote or RustDesk. If you typed it in a terminal-only session, the dialog appears on the desktop where you cannot see or click it.

  3. Method 2: download the installer from the developer site

    The downloads page on the Apple Developer site lists installer packages for each Command Line Tools version. Sign in with your Apple Account, search, download, double-click to install, and enter the admin password when prompted. Use this route when you need a specific version or the dialog method fails.

    According to Apple's documentation, only one version of this package can be installed on a Mac at a time.

  4. Confirm it is installed, and which version

    pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
    xcode-select --print-path

    The first shows the version and install time of the standalone package. The second shows the developer directory the command line is actually using right now. The two can differ: the standalone package and Xcode can both be present.

  5. With both Xcode and the standalone package present, which one is active

    If xcode-select --print-path points to /Library/Developer/CommandLineTools and you try to use xcodebuild, you get an error saying a full Xcode cannot be found. Go to the Command Line Tools menu under Xcode > Settings > Locations, select Xcode, and enter the admin password when prompted.

  6. Updating: update only the tools, not the operating system

    Apple's documentation says the standalone package is updated through Software Update in System Settings. On a rented machine, look carefully before you click: install only the Command Line Tools item, and do not tick a macOS upgrade along with it. A system upgrade drops the remote connection, so contact support first to confirm the recovery procedure.

  7. Uninstalling and ending the rental

    The commands for uninstalling the standalone package and for stopping its updates are in Apple's documentation. They require superuser privileges, so we do not reproduce them here. There is usually no need to uninstall.

    The Command Line Tools themselves contain none of your accounts or data, so they need no special handling before the rental ends. What does need handling is what you put there yourself, such as git credentials and SSH keys.

FAQ

Homebrew asks to install the Command Line Tools during setup. Should I accept?

Yes. Homebrew depends on the compiler and git they contain. If full Xcode is already installed, the prompt usually does not appear again.

What if the dialog never appears?

First confirm you ran the command in the Terminal app on the graphical desktop. If there is still no response, use the installer package from the developer site instead. For specific error messages, go by Apple's documentation.

I only do Flutter or React Native. Do I need full Xcode?

If iOS is one of your targets, yes. Building an iOS app uses xcodebuild and the iOS SDK, and the standalone package does not include xcodebuild.

Does updating the Command Line Tools affect the remote connection?

Updating the tools package on its own does not require a restart. What affects the connection is a system upgrade or restart, so do not select a macOS version upgrade along with the update.

Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support

Back to home · All guides