Published on

Fixing the path to Xcode after installing the latest version on macOS Monterey

Last Modified on
Last modified on
Authors
Fixing the path to Xcode after installing the latest version on macOS
Monterey
Photo by Connor Botts on Unsplash

Today, after seeing a tweet on Twitter regarding what the latest version of Git had to offer (which I subsequently found I could not install with the latest version of Xcode), I decided it was about time to update Git. And that meant updating Xcode first.

I ran over to the Apple Developer site, and grabbed the first version of Xcode that I saw, which was Xcode 14.0 beta. Of course it took forever to download. Then it took forever to expand from the .xip folder. And then I deleted my previous version from Applications, and dragged over the new version into Applications. But when I checked to see whether the install was successful, it threw an error. An error which I knew meant that the version was incompatible with Monterey. It was meant for Ventura. And I already knew that my computer was too old and therefore not compatible with it. To learn more about macOS ventura and which Mac computers are compatible with it, please visit the article entitled How to install the macOS Ventura public beta on The Verge. The publish date is July 11, 2022. Man, was I bummed. And I knew what that meant. The time was approaching to get a new computer (laptop)!

But back to the subject at hand. After finding out which version of Xcode was compatible with macOS Monterey, I went back into the Apple Developer site and downloaded Xcode version 13.4.1. After removing version 14.0 from Applications, moving it to the trash, and then moving expanded version 13.4.1 into Applications, when I checked to see whether the install was successful, an error was thrown.

I ran xcodebuild -version to make sure that Xcode was installed correctly. Instead of the version of Xcode that I installed being printed to the Terminal console, I got an error that I either had to change the path of my Xcode install, or I had to install CLT (Command Line Tools) by running the xcode-select --install command. I ran the xcode-select --install command, even though I had already done so and therefore no longer had any CLT related updates to download. And when I did so, I was prompted with the message that it was already installed.

I searched for the answer as to how I could correct the path to Xcode in Applications. I pretty quickly came up with the article entitled Xcode-select active developer directory error on iTecNote.com, published on July 11, 2022 (very recent). I followed the suggestion to run the command sudo xcode-select -s /Applications/Xcode.app/Contents/Developer, and it worked like a charm!

Next, I checked to make sure that CLT recognized Git, so I ran git --version in Terminal. I did not receive the version number I was hoping for (2.37.1), which I thought would have come with Xcode 14.0. Git version 2.32.1 was returned instead. The version I had previously was 2.30.1, so not that great an upgrade, but still better than 2.30.1. I guess I will have to wait a while before I am able to just "git push" to push new branches. No more "--set-upstream origin". OR I could re-install it with Homebrew, which I found out has the absolute latest version of Git: 2.37.1! That might be the next post I write about.

Happy Xcoding!