如何将 OSX 上的 Xcode 更新到最新版本?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15417619/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do you update Xcode on OSX to the latest version?
提问by Evan R.
What is the easiest way to update Xcode on OSX?
在 OSX 上更新 Xcode 的最简单方法是什么?
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?
但是打开后Xcode > Preferences > Downloads
提示没有更新?
回答by jjn
Open up App Store
Look in the top right for the updates section
Find Xcode & click Update
打开应用商店
在右上角查看更新部分
找到Xcode并点击更新
回答by L_K
softwareupdate --list
see the list of outdated software.
softwareupdate --list
查看过时软件列表。
softwareupdate --install --all
update all outdated software.
softwareupdate --install --all
更新所有过时的软件。
softwareupdate --install <product name>
update the software you named.
softwareupdate --install <product name>
更新您命名的软件。
回答by Phan Van Linh
回答by kris
If attempting to download via the App Store leaves you with a little grey spinner and nothing actually happening, then you can go to :
如果尝试通过 App Store 下载让您看到一个灰色的微调,而实际上什么也没发生,那么您可以转到:
https://developer.apple.com/download/more/
https://developer.apple.com/download/more/
log in with your Apple Developer ID, and the latest Xcode should be available as a .zip download.
使用您的 Apple Developer ID 登录,最新的 Xcode 应该以 .zip 下载的形式提供。
回答by Arkady
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
在我的情况下(Xcode 6.1,iOS 8.2)我没有在 AppStore 中看到更新。我找到了 Xcode 6.2 供下载并按下“安装”。然后,它安装并要求更新(超过 2 Gb)。Xcode 6.2 在 iOS 8.2 和 iOS 8.1.2 上正常工作
Hopefully this tip will help somebody else...
希望这个提示能帮助别人......
回答by Hymanocnr
If you want the latest Beta, it will not be in the AppStore. Instead you have to login to https://developer.apple.comand download from there.
如果您想要最新的 Beta,它不会在 AppStore 中。相反,您必须登录https://developer.apple.com并从那里下载。
回答by Akshay Thorve
Another best way to update and upgrade OSX development tools using command line is as follows:
使用命令行更新和升级 OSX 开发工具的另一种最佳方法如下:
Open terminal on OSX and type below commands. Try 'sudo' as prefix if you don't have admin privileges.
在 OSX 上打开终端并输入以下命令。如果您没有管理员权限,请尝试使用“sudo”作为前缀。
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.
这些将更新所有包,如 node、rethinkDB 等等。
Also, softwareupdate --install --all
this command also work best.
此外,softwareupdate --install --all
此命令也最有效。
Important: Remove all outdated packages and free some space using the simple command.
重要提示:使用简单命令删除所有过时的软件包并释放一些空间。
brew cleanup
回答by Selly
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.
我运行的是旧版本的 Xcode(与 ios 9.2 不兼容),所以我需要更新。
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.
我在这上面花了几个小时,并且不断地在应用程序商店中获得死亡之轮。没有任何效果。我尝试了 CLI 软件更新,更新 OSX,一切。
I ultimately had to download AppZapper, then nuked XCode.
我最终不得不下载 AppZapper,然后用 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.
从这里我终于可以升级到新版本的 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...
警告:AppZapper 也可以删除您在 Xcode 周围的所有数据,因此请准备好从头开始处理您的配置文件、密钥等。此外,根据此处的其他说明,当然要准备好进行 3-5 小时的下载探险。 .
回答by jcccn
You DO NOT need to upgrade Xcode.
您不需要升级 Xcode。
Just open the file /usr/local/Homebrew/Library/Homebrew/extend/os/mac/diagnostic.rb
,
直接打开文件/usr/local/Homebrew/Library/Homebrew/extend/os/mac/diagnostic.rb
,
then remove this line check_xcode_minimum_version
in the following function.
然后check_xcode_minimum_version
在以下函数中删除此行。
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.
然后brew install
应该工作正常。