Skip to content

Instantly share code, notes, and snippets.

@Rodeo314
Rodeo314 / install-xcode-cli-tools.sh
Created September 6, 2021 16:07 — forked from mokagio/install-xcode-cli-tools.sh
Install Xcode CLI Tools without GUI
View install-xcode-cli-tools.sh
#!/bin/bash
# See http://apple.stackexchange.com/questions/107307/how-can-i-install-the-command-line-tools-completely-from-the-command-line
echo "Checking Xcode CLI tools"
# Only run if the tools are not installed yet
# To check that try to print the SDK path
xcode-select -p &> /dev/null
if [ $? -ne 0 ]; then
echo "Xcode CLI tools not found. Installing them..."