2

I installed Xcode 12.2 on my MBP. I installed it from App Store and it's 28 gb, while my Mac only has a SSD of 128gb.

I use vscode for all my c/c++ programs so is there a need for me to keep Xcode on my device?

Nimesh Neema
  • 51,809
  • https://apple.stackexchange.com/questions/397221/error-xcodebuild-requires-xcode/397225#397225 – anki Nov 14 '20 at 11:03

3 Answers3

2

For C/++ you only need the compiler (clang)/toolchain, which can be installed via commandline:

xcode-select --install
Gummibando
  • 3,067
0

No

You'd need to install Xcode only if you wish to build native apps for macOS, iOS/iPadOS, watchOS or tvOS.

Compiling/Building C/C++ programs does not require you to have a full Xcode installation.

Nimesh Neema
  • 51,809
0

You can download and install the Command Line Tools to save space. These tools are enough to compile your project to an executable binary:

What is the Command Line Tools Package?

The Command Line Tools Package is a small self-contained package available for download separately from Xcode and that allows you to do command line development in macOS. It consists of the macOS SDK and command-line tools such as Clang, which are installed in the /Library/Developer/CommandLineTools directory.

You can remove the Xcode application and run the Terminal command:

 xcode-select --install
Graham Miln
  • 43,776