Skip to content

Instantly share code, notes, and snippets.

@mr-pinzhang
Last active August 22, 2023 04:24
Show Gist options
  • Star 78 You must be signed in to star a gist
  • Fork 31 You must be signed in to fork a gist
  • Save mr-pinzhang/2b0f5c3f18981a027afe to your computer and use it in GitHub Desktop.
Save mr-pinzhang/2b0f5c3f18981a027afe to your computer and use it in GitHub Desktop.
Xcode 文件下载

在 Xcode 里下载文件真的是一种折磨, 特别是每次 Xcode 大版本更新都会遇到新的下载内容. 经过一翻周折, 本人找到一个方法可以轻松快速便捷地下载和安装对应的 Simulator 和 Doc 文件

  1. 在 Mac 下, 打开 Xcode, 进入 Preference 中的 Downloads 面板
  2. 点击任意的下载按钮
  3. 打开系统帮助工具 Console
  4. 稍等一会儿, 在 Xcode 里取消下载, 然后你会在 Console 里面看到对应的下载地址 (对应的 Cosnole Message 是 (DVTDownloadable: Download Cancelled. Downloadable: ...) 之类的)
  5. 复制对应的链接地址, 到某雷或者任何比 Xcode 下载快的工具里
  6. 等待下载完成, 进入 /Users/#{Username}/Library/Caches
  7. 找到 com.apple.dt.Xcode 文件, 右击选择 Show Packages Contents
  8. 进入 Downloads 目录 (如果没有, 则手动创建一个 Downloads 目录)
  9. 将下载好的文件移动到 Downloads 目录 (最好不要改动文件名)
  10. 重启 Xcode, 回到 Downloads 面板, 点击对应下载好的 Simulator 或者 Doc
  11. Where Amazing Happens

本人的 Xcode 是 7.2.1 (7C1002) 具体的实现方法没有研究过, 望有心人指点出来 还有不在 Download 列表里的文件我也不知道该如何安装, 望指点 安装成功后, 应该会在 /Library/Developer/CoreSimulator/Profiles 里找到对应的文件

本人测出来的链接 (可能会有对应的更改, 欢迎大家补充):

@ye4241
Copy link

ye4241 commented Feb 25, 2016

9.0 url有问题,建议直接贴地址吧,复制粘贴到迅雷就下载了

https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_0-9.0.1.1443554484.dmg

@mr-pinzhang
Copy link
Author

下载的时候建议用 http, 否则有时候容易被迅雷拒绝

@mr-pinzhang
Copy link
Author

@ye4241 Nice, 我改一下

@zmlu
Copy link

zmlu commented Mar 23, 2016

Watch OS 2.0 :
https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.WatchSimulatorSDK2_0-2.0.1.1446084258.dmg

@nicreals
Copy link

@sylarhcn
Copy link

没有com.apple.dt.Xcode 怎么办xcode 7.3.1

@6david9
Copy link

6david9 commented Jun 11, 2016

@ganjmeng
Copy link

ganjmeng commented Sep 2, 2016

创建不了文件夹是什么情况啊,不能写文件进去

@FourmiZ
Copy link

FourmiZ commented Sep 7, 2016

添加模拟器时报错:Invalid runtime: com.apple.CoreSimulator.SimRuntime.iOS-8-1

@FourmiZ
Copy link

FourmiZ commented Sep 7, 2016

解决了,重启电脑即可,可能跟在添加文件的时候的权限有关

@nathan-szz
Copy link

下载之后添加进去,所有步骤之后,进入xcode 点击下载 仍然要下载其他的文件 速度依然奇慢.. 我的是 Xcode8

@aelam
Copy link

aelam commented Sep 28, 2016

Xcode8下不管用
感觉换路径了

@HollyMadCow
Copy link

HollyMadCow commented Dec 13, 2016

/Users/#{Username}/Library/Caches下面有个fsCachedData文件夹,一般有个当天最新创建的文件,比如我的叫D36CF847-5D81-4A1D-B5DC-32D32893C1EB这个文件,双击打开,拉动最底部会出现最新的doc下载地址,如下:

<!-- START Xcode 8.2 FCS -->
<!-- START conceptual doc set -->
<dict>
  <key>fileSize</key>
  <integer>1125092405</integer>
  <key>identifier</key>
  <string>com.apple.adc.documentation</string>
  <key>name</key>
  <string>Guides and Sample Code</string>
  <key>source</key>
  <string>https://devimages.apple.com.edgekey.net/docsets/20161212/031-91455-A.dmg</string>
  <key>userInfo</key>
  <dict>
    <key>ActivationPredicate</key>
    <string>$XCODE_VERSION &gt;= '8.2'</string>
    <key>Category</key>
    <string>Documentation</string>
    <key>IconType</key>
    <string>IDEDownloadablesTypeDocSet</string>
    <key>InstallPrefix</key>
    <string>$(HOME)/Library/Developer/Shared/Documentation/DocSets</string>
    <key>InstalledIfAllReceiptsArePresentOrNewer</key>
    <dict>
      <key>com.apple.pkg.1.0.ConceptualDocset</key>
      <string>10.9.0.0.1.1481247714</string>
    </dict>
    <key>RequiresADCAuthentication</key>
    <false/>
    <key>Summary</key>
    <string>My description of content</string>
  </dict>
  <key>version</key>
  <string>4.8</string>
</dict>
<!-- END conceptual doc set -->
<!-- END Xcode 8.2 FCS -->


下载完成后根据这段里面的node,自己更改文件名,规则是:按照 identifier string + - + version string + .dmg 的格式重命名文件

如8.2的doc应该是com.apple.adc.documentation-4.8.dmg,放入上面说的downloads目录,打开xcode,点击下载.....,这下应该是可以直接完成了

@xushuduo
Copy link

xushuduo commented Apr 7, 2017

Xcode 8.2.1 管用,谢谢楼主!!

@yutucc
Copy link

yutucc commented Apr 16, 2017

同问,没有 com.apple.dt.Xcode,版本:Version 8.2.1 (8C1002)

@ceekay1991
Copy link

有8.0模拟器吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment