手动下载Xcode文档集

rei*_*ein 14 documentation xcode

由于我不知道的原因,Xcode无法从服务器下载文档集.

有没有办法从URL手动下载这些文档集,然后让Xcode的核心参考库解压缩它们?

编辑:

找到我要找的东西:

http://learning2code.blogspot.com/2008/05/download-xcode-docsets-to-your-hard.html

Ami*_*Kh. 8

对于Xcode 7.0和更新的版本,您应该按照以下步骤手动下载和安装文档集:

  1. 首先,您应该在以下链接中找到您正确的项目:https: //developer.apple.com/library/downloads/docset-index.dvtdownloadableindex

例如以下内容:

<!-- START iOS 9 doc set -->
<dict>
  <key>fileSize</key>
  <integer>1065107366</integer>
  <key>identifier</key>
  <string>com.apple.adc.documentation.iOS</string>
  <key>name</key>
  <string>iOS 9.0 Documentation</string>
  <key>source</key>
  <string>https://devimages.apple.com.edgekey.net/docsets/20150916/031-34987-A.dmg</string>
  <key>userInfo</key>
  <dict>
    <key>ActivationPredicate</key>
    <string>$XCODE_VERSION &gt;= '7.0' &amp;&amp; $XCODE_VERSION &lt; '7.1'</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.7.0.iOSDocset</key>
      <string>10.9.0.0.1.1442278660</string>
    </dict>
    <key>RequiresADCAuthentication</key>
    <false/>
    <key>Summary</key>
    <string>My description of content</string>
  </dict>
  <key>version</key>
  <string>90.9</string>
</dict>
<!-- END iOS 9 doc set -->
Run Code Online (Sandbox Code Playgroud)
  1. source字符串下载文件.在我们的示例中:https://devimages.apple.com.edgekey.net/docsets/20150916/031-34987-A.dmg

  2. 使用以下结构重命名下载的文件:

"identifier string" + "-" + "version string" + ".dmg"

在我们的例子中:
com.apple.adc.documentation.iOS-90.9.dmg

  1. 然后把它放到:
    ~/Library/Caches/com.apple.dt.Xcode/Downloads/

如果没有Download文件夹,请创建它.
我建议你删除所有带.dvtdownloadableindex扩展名的文件(如果有的话).

  1. 转到InstallPrefix字符串文件夹并删除存在相关的docsets(如果存在).

在我们的示例中$(HOME)/Library/Developer/Shared/Documentation/DocSets,引用的文件夹~/Library/Developer/Shared/Documentation/DocSets.然后com.apple.adc.documentation.iOS.docset从那里删除文件.

(在某些情况下,$(DEVELOPER)/Applications/Xcode.app/Contents/Developer).

  1. 打开Xcode,转到首选项.... 在"下载"选项卡中,只需单击文档的下载箭头即可.您发现Xcode只是通过了下载进度并安装了文档.