# Install Command-line tools as dependency for Homebrew
xcode-select --install # Sets the development directory path to /Library/Developer/CommandLineTools
# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Mas (command-line interface for Mac App Store)
brew install mas
# Search for Xcode showing only the first 5 results
mas search xcode | head -5
# Install Xcode using App ID
mas install 497799835 # The appid for Xcode shown when doing search
sudo xcode-select -r # Reset the development directory path to put to Xcode /Applications/Xcode.app/Contents/Developer
#sudo xcodebuild -license
# Updaate all Apple software and auto agree to any licenses and restart if necessary
sudo softwareupdate --install --agree-to-license -aR
My Mac somehow decided to upgrade my Xcode to 11 while I am running OSX 10.14.1. I needed to download Xcode 10, except the developer.apple.com/Developer_Tools is keep dying on me. How does it upgrade from 10 to 11 but I can't download 10 back is beyond me.
Thank you with your suggestion. I am trying. It already failed half way once.
Install Xcode from command line
I had to un-comment #sudo xcodebuild -license to get it to work.
My Mac somehow decided to upgrade my Xcode to 11 while I am running OSX 10.14.1. I needed to download Xcode 10, except the developer.apple.com/Developer_Tools is keep dying on me. How does it upgrade from 10 to 11 but I can't download 10 back is beyond me.
Thank you with your suggestion. I am trying. It already failed half way once.
Amazing! thanks for sharing @Jahir
Thanks Jahir! Quite helpful. Fell into the same issue trying to download xcode over a couple of days
hello, very helpful post. may i ask, what if my mac shuts down how do i resume the download? thx
iirc running the same command again, from the same location, should continue the download
Thanks Jahir - very useful
please will this affect being able to automatically get updates? if so, how then can we update xcode when an update is available?
Hi ... unfortunately I didn't use Xcode long enough to give you a proper answer about that
Okay, thanks for the speedy reply though. I’m grateful.
Thank you! Been using this guide for more than a year now and it still works!
I'm glad it's been helpful and it's still working 😅 (sorry for the delayed response)
This in combination with dev.to/szashik440/running-app-on-i... made me WAY less frustrated to work on Xcode during an updating period