235

What is the easiest way to update Xcode on OSX?

I see this in the terminal:

$ brew install xxxxxxx
Warning: Your Xcode (4.3.3) is outdated
Please install Xcode 4.6.

But when I go to open up Xcode > Preferences > Downloads, it says there are no updates?

4

14 回答 14

331
  1. Open up App Store

    enter image description here

  2. Look in the top right for the updates section (may also be in lefthand column "Updates"..)

    enter image description here

  3. Find Xcode & click Update enter image description here

于 2013-03-14T18:49:10.560 回答
105

softwareupdate --list see the list of outdated software.

softwareupdate --install --all update all outdated software.

softwareupdate --install <product name> update the software you named.

于 2016-06-14T03:25:12.747 回答
67

Sometime I don't see the Xcode update in Updates tab in AppStore
So I search Xcode in AppStore enter image description here

Then click update and it update

于 2016-05-05T07:19:54.083 回答
60

enter image description here

If attempting to download via the App Store leaves you with a little grey spinner and nothing actually happening, then you can go to :

https://developer.apple.com/download/more/

log in with your Apple Developer ID, and the latest Xcode should be available as a .zip download.

于 2017-05-30T00:24:24.083 回答
36

In my case (Xcode 6.1, iOS 8.2) I did not see the update in AppStore. I found Xcode 6.2 for download and pressed "Install". Then, it installed and asked for the update (more than 2 Gb). Xcode 6.2 works correctly with iOS 8.2 and iOS 8.1.2

Hopefully this tip will help somebody else...

于 2015-04-05T16:36:11.597 回答
10

xcode-select --install worked for me

于 2020-01-08T17:59:46.020 回答
7

If you want the latest Beta, it will not be in the AppStore. Instead you have to login to https://developer.apple.com and download from there.

于 2015-09-04T18:10:45.887 回答
4

Another best way to update and upgrade OSX development tools using command line is as follows:

Open terminal on OSX and type below commands. Try 'sudo' as prefix if you don't have admin privileges.

brew update

and for upgrading outdated tools and libraries use below command

brew upgrade

These will update all packages like node, rethinkDB and much more.

Also, softwareupdate --install --all this command also work best.

Important: Remove all outdated packages and free some space using the simple command.

brew cleanup
于 2017-09-11T23:17:04.790 回答
3

I ran into this bugger too.

I was running an older version of Xcode (not compatible with ios 9.2) so I needed to update.

I spent hours on this and was constantly getting spinning wheel of death in the app store. Nothing worked. I tried CLI softwareupdate, updating OSX, everything.

I ultimately had to download AppZapper, then nuked XCode.

I went into the app store to download and it still didn't work. Then I rebooted.

And from here I could finally upgrade to a fresh version of xcode.

WARNING: AppZapper can delete all your data around Xcode as well, so be prepared to start from scratch on your profiles, keys, etc. Also per the other notes here, of course be ready for a 3-5 hour long downloading expedition...

于 2016-07-28T22:54:18.453 回答
2

I used the Command_Line_Tools_OS_X_10.XX_for_Xcode_7.2.dmg and therefore had to download the latest version from here.

于 2016-05-11T21:52:29.973 回答
2

You can try mas-cli (Mac App Store cli). Github project here

It would be

$ brew install mas
$ mas list
$ mas search Xcode
$ mas install <id> 

$ mas upgrade <id>

upd:

Had issues installing Xcode 12.2 in Big Sur. Solved them by entering into the App Store from the devs link.

https://developer.apple.com/download/release/

于 2020-11-18T05:31:29.720 回答
2

Check https://xcodereleases.com/ where you can also download legacy versions.

于 2021-01-23T04:47:56.373 回答
1

For me it was >41GB for the update to start. ~/Library contains a lot of cached content for mail, browsers, etc...you can safely remove those. Remove big apps too, like iMovie..you can always install it back later

于 2021-05-27T00:36:19.723 回答
0

You DO NOT need to upgrade Xcode.

Just open the file /usr/local/Homebrew/Library/Homebrew/extend/os/mac/diagnostic.rb ,

then remove this line check_xcode_minimum_version in the following function.

def fatal_build_from_source_checks
    %w[
      check_xcode_license_approved
      check_xcode_minimum_version //<-- this one
      check_clt_minimum_version
      check_if_xcode_needs_clt_installed
    ].freeze
    end

Then brew install should works fine.

于 2019-05-22T08:03:29.813 回答