DEV Community

Direct download any Xcode

Jahir Fiquitiva on October 29, 2018

Downloading Xcode from the App Store, or even the .xip file while using a browser, regardless of which one it is, can be a pain when your conn...
Collapse
 
dcondrey profile image
David Condrey •

Install Xcode from command line

# 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
Enter fullscreen mode Exit fullscreen mode
Collapse
 
wookiee666 profile image
wookiee666 •

I had to un-comment #sudo xcodebuild -license to get it to work.

Collapse
 
burakuslu profile image
Burak Uslu •

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.

Collapse
 
mosoakinyemi profile image
Akinyemi Mosolasi •

Amazing! thanks for sharing @Jahir

Collapse
 
ericgm profile image
Eric Githinji •

Thanks Jahir! Quite helpful. Fell into the same issue trying to download xcode over a couple of days

Collapse
 
raphaq profile image
RaphaQ •

hello, very helpful post. may i ask, what if my mac shuts down how do i resume the download? thx

Collapse
 
jahirfiquitiva profile image
Jahir Fiquitiva •

iirc running the same command again, from the same location, should continue the download

Collapse
 
baronmax profile image
baronmax •

Thanks Jahir - very useful

Collapse
 
wisdomfolutile profile image
Wisdom Deji-Folutile •

please will this affect being able to automatically get updates? if so, how then can we update xcode when an update is available?

Collapse
 
jahirfiquitiva profile image
Jahir Fiquitiva •

Hi ... unfortunately I didn't use Xcode long enough to give you a proper answer about that

Collapse
 
wisdomfolutile profile image
Wisdom Deji-Folutile •

Okay, thanks for the speedy reply though. I’m grateful.

Collapse
 
karla profile image
Karla Pangilinan •

Thank you! Been using this guide for more than a year now and it still works!

Collapse
 
jahirfiquitiva profile image
Jahir Fiquitiva •

I'm glad it's been helpful and it's still working 😅 (sorry for the delayed response)

Collapse
 
sebastienkb profile image
Sébastien Kalb •

This in combination with dev.to/szashik440/running-app-on-i... made me WAY less frustrated to work on Xcode during an updating period