Xcode#

  • Author: Fu Yin

  • Update: July 29, 2022

  • Reading: 30 min


Introduction#

Xcode is an integrated development environment (IDE) for MacOS, similar to Microsoft Visual Studio for Windows. Command Line Tools for Xcode is a part of Xcode which contains common development tools, such as C/C++ compiler (gcc, g++), make, git, etc. It is a necessary software for programming in MacOS.

Install#

Type the following command in terminal to install Command Line Tools for Xcode

xcode-select --install

Warning

Xcode also can be installed in App Store, but is so large usually needed >10G. So I recommend to install Command Line Tools for Xcode.

  • The Command Line Tools for Xcode installed here may not be the latest version. Click the Apple icon in the upper left corner of your desktop and check for updates in Software Updates under System Preferences. If so, upgrade it to the latest version.

  • After the MacOS is updated, sometimes you need to reinstall the Command Line Tools for Xcode and run the preceding commands again.

../_images/Xcode-1.jpg

Fig. 1 Update Xcode#

How can I uninstall the command-line tools?

# print the install path which usually is "/Library/Developer/CommandLineTools"
xcode-select --print-path

# delete it
sudo rm -rf /Library/Developer/CommandLineTools