手动下载 Xcode 文档集
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1131119/
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
Download Xcode documentation sets manually
提问by rein
For reasons unknown to me, Xcode fails to download the documentation sets from the server.
由于我不知道的原因,Xcode 无法从服务器下载文档集。
Is there a way to download these documentation sets manually from a URL and then have Xcode's Core Reference Library unpack them?
有没有办法从 URL 手动下载这些文档集,然后让 Xcode 的核心参考库解压它们?
EDIT:
编辑:
Found what I was looking for:
找到了我要找的东西:
http://learning2code.blogspot.com/2008/05/download-xcode-docsets-to-your-hard.html
http://learning2code.blogspot.com/2008/05/download-xcode-docsets-to-your-hard.html
采纳答案by rein
回答by Amir Kh.
For Xcode 7.0 and maybe newer versions you should follow these steps to download and install documentation sets manually:
对于 Xcode 7.0 或更新的版本,您应该按照以下步骤手动下载和安装文档集:
- At first you should find your proper item in the below link: https://developer.apple.com/library/downloads/docset-index.dvtdownloadableindex
- 首先,您应该在以下链接中找到合适的项目:https: //developer.apple.com/library/downloads/docset-index.dvtdownloadableindex
For example the following:
例如以下内容:
<!-- 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 >= '7.0' && $XCODE_VERSION < '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 -->
Download the file from
source
string. In our example: https://devimages.apple.com.edgekey.net/docsets/20150916/031-34987-A.dmgRename the downloaded file using following structure:
从
source
字符串下载文件。在我们的示例中:https: //devimages.apple.com.edgekey.net/docsets/20150916/031-34987-A.dmg使用以下结构重命名下载的文件:
"identifier string" + "-" + "version string" + ".dmg"
"identifier string" + "-" + "version string" + ".dmg"
In our example:com.apple.adc.documentation.iOS-90.9.dmg
在我们的例子中:com.apple.adc.documentation.iOS-90.9.dmg
- Then place it to:
~/Library/Caches/com.apple.dt.Xcode/Downloads/
- 然后将其放置到:
~/Library/Caches/com.apple.dt.Xcode/Downloads/
If there is no Download
folder, create it.
I suggest you to remove all files with .dvtdownloadableindex
extension (if any exists).
如果没有Download
文件夹,请创建它。
我建议您删除所有带有.dvtdownloadableindex
扩展名的文件(如果存在)。
- Go to
InstallPrefix
string folder and remove existence related docsets (if any exists).
- 转到
InstallPrefix
字符串文件夹并删除与存在相关的文档集(如果存在)。
In our example the folder is $(HOME)/Library/Developer/Shared/Documentation/DocSets
which refers to ~/Library/Developer/Shared/Documentation/DocSets.
Then remove the com.apple.adc.documentation.iOS.docset
file from there.
在我们的示例中,文件夹是$(HOME)/Library/Developer/Shared/Documentation/DocSets
指~/Library/Developer/Shared/Documentation/DocSets.
然后com.apple.adc.documentation.iOS.docset
从那里删除文件。
(In some cases, $(DEVELOPER)
refers to /Applications/Xcode.app/Contents/Developer
).
(在某些情况下,$(DEVELOPER)
指/Applications/Xcode.app/Contents/Developer
)。
- Open Xcode, go to preferences... . In the Download tab, simply click download arrow for the document. You find that the Xcode just pass the download progress and install the document.
- 打开 Xcode,转到首选项...。在“下载”选项卡中,只需单击文档的下载箭头即可。你发现Xcode只是通过下载进度并安装文档。
回答by Matthew Todd
Augmenting the blog post mentioned in the accepted answer here, since its comments are closed:
增加此处接受的答案中提到的博客文章,因为其评论已关闭:
There's a separate feed for each OS release. You can follow the Snow Leopard documentation at http://developer.apple.com/rss/com.apple.adc.documentation.AppleSnowLeopard.atom
每个操作系统版本都有一个单独的提要。您可以按照http://developer.apple.com/rss/com.apple.adc.documentation.AppleSnowLeopard.atom 上的 Snow Leopard 文档进行操作
One way to find these URLs is to click the little "i" info icon for each DocSet in Xcode's Preferences -> Documentation -> Documentation Sets.
找到这些 URL 的一种方法是在 Xcode 的 Preferences -> Documentation -> Documentation Sets 中单击每个 DocSet 的小“i”信息图标。
回答by IlDan
If you are trying to download the iPhone docs you may be using an account that has no access to the docs.
如果您尝试下载 iPhone 文档,您可能使用的帐户无权访问这些文档。
Using Keychain Access, delete the 'connect.apple.com' entry, then attempt to download the docs and enter your iPhone-registered account info. -- Ronald Hayden, Cocoabuilder Xcode Archive
使用钥匙串访问,删除“connect.apple.com”条目,然后尝试下载文档并输入您在 iPhone 上注册的帐户信息。-- Ronald Hayden,Cocoabuilder Xcode 档案