如何从 xip 文件安装 Xcode

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43663097/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 18:25:46  来源:igfitidea点击:

How to install Xcode from xip file

xcodexcode8

提问by loki

I am very new to macOS, I just need a mac with Xcode to compile my app. However, with macOS Sierra, I have a problem with my USB that is not working anymore (i can't plug my ipad pro)

我对 macOS 非常陌生,我只需要一个带有 Xcode 的 mac 来编译我的应用程序。但是,使用 macOS Sierra,我的 USB 出现问题,无法再使用(我无法插入 ipad pro)

Under OSX el capitan my usb works great, but now the problem is that app store offer me to download the Xcode 8.3 only that can work only on Sierra (strange they offer you to download something not compatible with your system but doesn't matter, it's apple). so the only way i have is to download manually the xcode 8.2.1

在 OSX el capan 下,我的 USB 工作得很好,但现在的问题是应用商店让我下载只能在 Sierra 上运行的 Xcode 8.3(奇怪的是,他们让你下载与你的系统不兼容的东西,但没关系,是苹果)。所以我唯一的方法是手动下载 xcode 8.2.1

Now my question, how to install the Xcode_8.2.1.xip I just downloaded? and in near future, if I need to update xcode (I guess downloading myself a new version), how will I do? Also where the preferences and configurations settings are saved? does these preferences will be lost on each update?

现在我的问题是,如何安装我刚刚下载的 Xcode_8.2.1.xip?在不久的将来,如果我需要更新 xcode(我想为自己下载一个新版本),我该怎么办?首选项和配置设置也保存在哪里?这些首选项会在每次更新时丢失吗?

回答by wintermute

Double-click the xipfile and it will extract the Xcode application. Move Xcodeto the Applicationsfolder and you are good to go.

双击该xip文件,它将提取 Xcode 应用程序。移动XcodeApplications文件夹,你就可以开始了。

The App Store should present the Xcode update once you update to Sierra (macOS 10.12). If it doesn't you can download Xcode directly from the App Store. The preferences are stored in /Users/<username>/Library/Preferencesand are not impacted by updating the version of Xcode or OS.

更新到 Sierra (macOS 10.12) 后,App Store 应显示 Xcode 更新。如果没有,您可以直接从 App Store 下载 Xcode。首选项存储在/Users/<username>/Library/Preferences更新 Xcode 或 OS 的版本中,不受更新的影响。

回答by Дмитрий Васильев

For example, if a XIP file is located on your desktop: open the “Terminal” application found in /Applications/Utilities/ and run the following command:

例如,如果 XIP 文件位于您的桌面上:打开 /Applications/Utilities/ 中的“终端”应用程序并运行以下命令:

 xip -x ~/Desktop/Xcode_8.2.1.xip

回答by Divyesh_008

Convert the xip to a dmg by opening a terminal to the folder where the xip is placed and run the following commands:

通过打开终端到放置 xip 的文件夹并运行以下命令,将 xip 转换为 dmg:

$ open Xcode_X_Y_Z.xip
  $ mkdir Xcode-tmp
  $ mv Xcode.app Xcode-tmp/Xcode.app
  $ hdiutil create -volname "Xcode" \
            -srcfolder Xcode-tmp \
            -ov -format UDZO \
            Xcode_X.Y.Z.dmg
  $ rm -rf Xcode-tmp