Command Line Tools location in Sierra - xcode

I just updated to Sierra and installed Xcode 8.2.1 from the Developer Portal.
(Why didn't I use the App Store? Read here.)
In the past, to upgrade to new versions of Xcode, I would download both the main .xip and the CLT package from the portal, replace Xcode in /Applications and then install the tools package. With 8.x, it seems like the .xip contains both packages installed as Homebrew doesn't complain about the tools being slightly out of date - brew doctor.
However, brew config lists the CLT as N/A. If there isn't a separate download, how can I find their install location?
$ brew config
HOMEBREW_VERSION: 1.1.13-19-g55c02ae77
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 55c02ae7747bf05eadec95c91497d06ec3dd2ded
Last commit: 17 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: c1b829f4e31955bc8c9e19227ab7a41e92ab9b77
Core tap last commit: 3 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: octa-core 64-bit haswell
Homebrew Ruby: 2.0.0-p648
Clang: 8.0 build 800
Git: 2.12.2 => /usr/local/bin/git
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /Users/Chris/.rbenv/shims/ruby => /usr/local/Cellar/ruby/2.4.1_1/bin/ruby
Java: N/A
macOS: 10.12.3-x86_64
Xcode: 8.2.1
CLT: N/A
X11: N/A

Worse, having the CLT for Xcode automatically downloaded and installed on my Macbook Pro on April 26, 2017 causes weird things such as unusable built-in camera.
Built-in camera remains unusable after 3 reboots.
Had to uninstall XCode after that update that said:
Command Line Tools (macOS Sierra version 10.12) for Xcode
Version 8.3. The Command Line Tools enable UNIX-style development...
Installed Apr 26, 2017
Xcode 8.3.2 includes Swift 3.1 and SDKs for iOS 10.3 ...
Installed Apr 20, 2017
Then camera starts working again after reboot.

Related

_ctermid.h not found on macOS Mojave 10.14.6

On macOS Mojave 10.14.6 (18G7016), gcc can't find the file _ctermid.h anymore
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/wchar.h:90,
from /usr/local/Cellar/gcc/10.2.0_2/include/c++/10.2.0/cwchar:44,
from /usr/local/Cellar/gcc/10.2.0_2/include/c++/10.2.0/bits/postypes.h:40,
from /usr/local/Cellar/gcc/10.2.0_2/include/c++/10.2.0/bits/char_traits.h:40,
from /usr/local/Cellar/gcc/10.2.0_2/include/c++/10.2.0/string:40,
from /Users/Projects/test.h:10,
from /Users/Projects/test.cpp:1:
/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10/gcc/x86_64-apple-darwin18/10.2.0/include-fixed/stdio.h:219:10: fatal error: _ctermid.h: No such file or directory
219 | #include <_ctermid.h>
This was either caused by a macOS software update or brew upgrade.
This is might be related to an older question Can't compile C program on a Mac after upgrade to Mojave.
I tried the suggested solutions:
deleting the whole CommandLineTools folder with (sudo) rm -rf /Library/Developer/CommandLineTools and reinstalled it xcode-select --install
installed the macOS_SDK_headers_for_macOS_10.14 with open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
reinstalled brew and gcc (also gcc#9 and gcc#8)
None of them worked.
For some reason, xcode-select --install does not install the most recent Command Line Tools for macOS 10.14 (Mojave).
It always installs the version for Xcode 10.
To fix the issue, download and install Command Line Tools for Xcode 11.3.1. That’s the most recent version of the CLT that still work for Mojave.
In case the direct link above doesn’t work, go to “More Downloads for Apple Developers”, log in with an Apple Developer account, and search for “Command Line Tools for Xcode 11.3.1”. Note that this is not the most recent version of the CLT, but more recent versions can’t be installed on Mojave.

No Xcode CLT listed by Homebrew in macOS High Sierra

Since updating to macOS High Sierra, Homebrew reports CLT: N/A:
macOS: 10.13.1-x86_64
Xcode: 9.1
CLT: N/A
Previously this entry had reported the version information for the Xcode command line tools.
Do I need to do something to fix this? Is this an expected change with macOS 10.13?
The update to High Sierra will remove any command line tools you've installed in the past, making necessary to simply (re)run
xcode-select --install
to (re)install them.

Xcode can’t be installed on “Macintosh HD”

Xcode can’t be installed on “Macintosh HD” because macOS version 10.12.6 or later is required.
my macitosh version is 10.12 but when i searched for update it asks no updates are available
An older Xcode version needs to be installed that is compatible with your macOS version. Older versions can be found here https://developer.apple.com/download/more/?q=xcode
You could install the latest version of Xcode which also has command line tools that support your version of macOS. For instance, if you have macOS 10.12 and there is a download titled Command Line Tools (macOS 10.12) for Xcode 9.2 then you should be safe to install Xcode version 9.2

xcode 6.1 installation process

I installed Yosemite a couple of days ago. It really broke quite a lot of things - broke my favorite game which won't start, broke my php installation, my wordpress installation, and now Homebrew! But the spotlight feature is nice, not that it makes up for it lol.
Nonetheless I'm trying to fix Homebrew which is telling me to update to XCode 6.1. I've run software update and it says the XCode 6.1 has been installed (sort of). It has:
Command Line Tools (OSX 10.10) - Version 6.1 Installed Oct 17, 2014 (twice actually)
Xcode Version 6.0.1 - Installed Oct 17, 2014
And no pending updates.
But when I check the locations tab in Xcode preferences - it says it's using Command Line Tools 6.0.1. And when I run brew doctor it tells me to upgrade to 6.1 CLT.
How do I update the CLT to 6.1? (note I'm not on Apple Developer program)
The link that #richard-g provided doesn't seem to work anymore, but I just found the dmg file on
https://developer.apple.com/downloads/
using an appleID that has only a free developer login.
On that page I found both Xcode 6.1 and the command line tools for OS X 10.10 for Xcode 6.1.
Before finding that, on the first machine that I upgraded from Maverick to Yosemite that already had Xcode installed on it, I was able to upgrade Xcode in the App Store and then run Xcode and from within it download and upgrade the command line tools, but App Store continues to show Xcode as one update available with just an "Open" button. I'll see if installing the downloaded dmg takes care of that, and in any case I have other machines to upgrade and could use the offline install package. The download site seems very very slow, though, the 2.5GB download is taking all day.
It worked - installing the 6.1 XCode from this download https://developer.apple.com/downloads/download.action?path=Developer_Tools/xcode_6.1/xcode_6.1.dmg
and it worked fine. I just had to go to Xcode -> Locations and select the 6.1 CLT, then open a new command prompt.
brew doctor
Your system is ready to brew.
========================================================
Sorry as per comments - the link to XCode is no longer working
As you have Xcode 6.1 installed, you can run xcode-select --install from a shell to download the correct CLT.
This link works without without requiring login:
https://developer.apple.com/downloads/index.action

Does Xcode 4 install git?

I bought a new MacBook Pro and installed the applications list below in order. On my old MacBook, also running OS X 10.6.6, I didn't have /usr/bin/git, however, on the new MacBook Pro, I do. The only differences that I can think of between the two systems are:
New MacBook Pro has Xcode 4 vs. Xcode 3 on old MacBook
New MacBook Pro installed git using homebrew vs. old MacBook installed [git-osx-installer][]
Homebrew installed git 1.7.4.1 into /usr/local/Cellar/git and symlinked it into /usr/local/bin. This leads me to believe that Xcode 4 installed git 1.7.3.4 into /usr/bin. Can anyone confirm or deny this?
If Xcode 4 didn't install git 1.7.3.4 into /usr/bin, any thoughts what program did?
Applications Installed in Order
First boot
Ran Apple's Software Update
Ran Bootcamp to create 48GB NTFS partition for Windows 7
Installed iWork '09 and ran software update to install iWork Update 5
Installed TextExpander 3.2.4
Installed Dropbox 1.0.20
Installed 1Password 3.5.9
Installed Alfred 0.8.2 (107)
Installed Adium 1.4.1
Started installation of Xcode4 via App Store
Installed Caffeine 1.1.1 via App Store
Installed Kindle via App Store
Completed installation of Xcode 4 via App Store
Installed Homebrew using the following command:
ruby -e "$(curl -fsSLk https://gist.github.com/raw/323731/install_homebrew.rb)"
Installed git using brew install git
Installed MacVim using brew install macvim
Update: Package Receipt Info
I ran pkgutil --file-info /usr/bin/git and the following info was displayed. This appears to incriminate Xcode 4.
volume: /
path: /usr/bin/git
pkgid: com.apple.pkg.GitLeo
pkg-version: 4.0.0.9000000000.1.1248867338
install-time: 1300459157
uid: 0
gid: 0
mode: 755
Why It's a Problem that Xcode 4 Installs git
By default, the path /usr/local/bin is after /usr/bin (see the file /etc/paths). This means that git 1.7.3.4 is used instead of 1.7.4.1 that Homebrew installed.
Yes, it does. I just finished the Xcode 4 install. git was previously installed to /usr/local/git.
I am new to OS X, and can only suggest swapping the order of those directories in /etc/paths.
Not sure what else would/might work.
Under Preferences, Downloads there was an option for Command Line Tools. I installed that and it worked well.
I just looked into this and found git in /Applications/Xcode.app/Contents/Developer/usr/bin after installing Xcode from the App Store on 10.7.4. Adding that directory to my PATH seems to have done the trick.
I had to install the command line tools. Here's a helpful answer https://github.com/mxcl/homebrew/issues/10244#issuecomment-4013781
Xcode 4 installs git at /Developer/usr/bin and at /usr/bin. Xcode 4 uses the version at /Developer/usr/bin. I believe Xcode 4 also invokes git with a full path, so changing the path variable won't change the version of git being used by Xcode 4 itself. Of course, if you are just using git outside of Xcode, none of this matters.
I have been dealing with that same problem. Since I added the new default push style to my git command several programs have been failing because they were still using some internal old version of git.
I think I gave a good temporal solution here:
https://apple.stackexchange.com/a/72524/26545

Resources