Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Xcode command line tools

I performed a fresh install of macOS Mojave 10.14. Immediately after that I installed Xcode Version 10.0 (10A255) from the Mac App Store.

Now, I wish to install Homebrew which requires Xcode command line tools to be installed. My understanding is that installing Xcode also installs the command line tools. Or not?

As per this answer, I checked if the command line tools are installed by running:

xcode-select -p

which printed the path for the Developer directory as follows:

/Applications/Xcode.app/Contents/Developer

As suggested in the answer, I also verified the return value by running:

echo $?

which retuned 0.

I also ran, gcc and make and bash was able to locate and execute them.

Thus far I am convinced that the Xcode command line tools are installed. Now when I execute:

xcode-select --install

I get this alert:

enter image description here

What's the probable reason for this disparity? Will this install Xcode command line tools twice? Or overwrite the existing installation?

As I understand, Xcode command line tools can be installed without installing Xcode. Also, from my previous experience, if the command line tools aren't installed separately from Xcode (by running xcode-select --install), they are not detected by Homebrew, i.e. when running brew config, the value for CLT: is shown as N/A.

Here's the complete picture (pardon the pun):

enter image description here

Although I am talking in context of macOS Mojave, the question remains the same with regard to previous versions of macOS.

What is the advisable approach to take here?

Note: After installing Xcode, I launched it, accepted license agreement and let it finish its run of installing additional tools (which is a one time activity).

like image 443
Nimesh Neema Avatar asked Sep 26 '18 09:09

Nimesh Neema


People also ask

How do I install command prompt tools?

You can install and update each package using Android Studio's SDK Manager or the sdkmanager command line tool. All of the packages are downloaded into your Android SDK directory, which you can locate as follows: In Android Studio, click File > Project Structure. Select SDK Location in the left pane.

Should I install command line developer tools on Mac?

Developers need to install Xcode Command Line Tools before they can develop software on a Mac. Apple provides a complete development environment for programmers named Xcode. If you are developing software for macOS, iOS, tvOS, and watchOS, you must install the full Xcode application.

How do I open Xcode command line tools on a Mac?

Start Xcode on the Mac. Choose Preferences from the Xcode menu. In the General window, click the Locations tab. On the Location window, check that the Command Line Tools option shows the Xcode version (with which the Command Line Tools were installed).

Can Xcode command line tools be installed without installing Xcode?

As I understand, Xcode Command Line Tools can be installed without installing Xcode. Also, from my previous experience, if the Command Line Tools aren't installed separately from Xcode (by running xcode-select --install ), they are not detected by Homebrew, i.e. when running brew config, the value for CLT: is shown as N/A.

How do I update the Xcode command line developer tools?

Or via terminal (from the release docs): The Command Line Developer Tools package can be installed on demand using " xcode-select --install ” and the installed tools will be automatically updated using Software Update. OS X 10.9 is required for this feature. For earlier versions, continue to use the in-app download in Xcode.

How do I run Xcode from terminal?

Running the command in terminal produces the following GUI: Xcode includes a new "Downloads" preference pane to install optional components such as command line tools, and previous iOS Simulators. To open this pane click the "Xcode" button in the top left of the screen near the Apple logo, then click "Preferences", then click "Downloads".

How much space does Xcode command line tools take on a Mac?

Luckily, the Xcode Command Line Tools package only requires 1.2GB of space on your disk. You have three choices to install Xcode Command Line Tools on a Mac: install Xcode Command Line Tools as part of a Homebrew installation. I don't recommend installing the full Xcode package unless you're developing software for an Apple device.


1 Answers

Following worked for me, only command line tool can also me installed.

After you updated to Mojave 10.14 Go to https://developer.apple.com/download/more/ search for "command line" then

Download "Command line tool for MacOS 10.14"

Once dmg is downloaded install the package.

Verify package installation enter image description here

like image 98
Jyoti Prakash Avatar answered Sep 19 '22 03:09

Jyoti Prakash