技术iOS征服iOS

Dash 安装 IOS文档 Apple 开发者离线文档下载

2015-12-14  本文已影响4569人  木猫尾巴

[TOC]

Why

苹果官网的IOS Developer Library是开发者最喜欢用的知识仓库,但由于有时打开它实在太慢了

官方文档索引路径 https://developer.apple.com/library/ios/navigation/

How

下载方法

打开这个官网提供的连接dvtdownloadableindex

这个链接返回的是XML数据,里面可以清晰的看到每个IOS版本的文档下载地址,以最新的ios9.2来说,拉到页面最底部,找到类似对称注释标记


<!-- START Xcode 7.2 FCS -->
<!-- START Xcode doc set -->
<dict>
    <key>fileSize</key>
    <integer>239503174</integer>
    <key>identifier</key>
    <string>com.apple.adc.documentation.Xcode</string>
    <key>name</key>
    <string>Xcode 7.2 Documentation</string>
    <key>source</key>
    <string>https://devimages.apple.com.edgekey.net/docsets/20151208/031-43201-A.dmg</string>
    <key>userInfo</key>
    <dict>
        <key>ActivationPredicate</key>
        <string>$XCODE_VERSION >= '7.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.5.0.DevToolsDocset</key>
            <string>10.9.0.0.1.1449203766</string>
        </dict>
        <key>RequiresADCAuthentication</key>
        <false/>
        <key>Summary</key>
        <string>My description of content</string>
    </dict>
    <key>version</key>
    <string>702.5</string>
</dict>
<!-- END Xcode doc set-->
<!-- START iOS doc set -->
<dict>
  <key>fileSize</key>
  <integer>1071665431</integer>
  <key>identifier</key>
  <string>com.apple.adc.documentation.iOS</string>
  <key>name</key>
  <string>iOS 9.2 Documentation</string>
  <key>source</key>
  <string>https://devimages.apple.com.edgekey.net/docsets/20151208/031-43202-A.dmg</string>
  <key>userInfo</key>
  <dict>
    <key>ActivationPredicate</key>
    <string>$XCODE_VERSION >= '7.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.7.0.iOSDocset</key>
      <string>10.9.0.0.1.1449203766</string>
    </dict>
    <key>RequiresADCAuthentication</key>
    <false/>
    <key>Summary</key>
    <string>My description of content</string>
  </dict>
  <key>version</key>
  <string>92.7</string>
</dict>
<!-- END iOS doc set -->
<!-- START OS X doc set -->
<dict>
  <key>fileSize</key>
  <integer>1305030657</integer>
  <key>identifier</key>
  <string>com.apple.adc.documentation.OSX</string>
  <key>name</key>
  <string>OS X 10.11.2 Documentation</string>
  <key>source</key>
  <string>https://devimages.apple.com.edgekey.net/docsets/20151208/031-43203-A.dmg</string>
  <key>userInfo</key>
  <dict>
    <key>ActivationPredicate</key>
    <string>$XCODE_VERSION >= '7.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.10.9.OSXDocset</key>
      <string>10.9.0.0.1.1449203766</string>
    </dict>
    <key>RequiresADCAuthentication</key>
    <false/>
    <key>Summary</key>
    <string>My description of content</string>
  </dict>
  <key>version</key>
  <string>1012.5</string>
</dict>
<!-- END OS X doc set -->
<!-- START watchOS doc set -->
<dict>
  <key>fileSize</key>
  <integer>400310052</integer>
  <key>identifier</key>
  <string>com.apple.adc.documentation.watchOS</string>
  <key>name</key>
  <string>watchOS 2.0 Documentation</string>
  <key>source</key>
  <string>https://devimages.apple.com.edgekey.net/docsets/20151208/031-43204-A.dmg</string>
  <key>userInfo</key>
  <dict>
    <key>ActivationPredicate</key>
    <string>$XCODE_VERSION >= '7.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.WatchOSDocset</key>
      <string>10.9.0.0.1.1449203766</string>
    </dict>
    <key>RequiresADCAuthentication</key>
    <false/>
    <key>Summary</key>
    <string>My description of content</string>
  </dict>
  <key>version</key>
  <string>3.3</string>
</dict>
<!-- END watchOS doc set -->
<!-- START tvOS doc set -->
<dict>
  <key>fileSize</key>
  <integer>400618247</integer>
  <key>identifier</key>
  <string>com.apple.adc.documentation.tvOS</string>
  <key>name</key>
  <string>tvOS 9.1 Documentation</string>
  <key>source</key>
  <string>https://devimages.apple.com.edgekey.net/docsets/20151208/031-43205-A.dmg</string>
  <key>userInfo</key>
  <dict>
    <key>ActivationPredicate</key>
    <string>$XCODE_VERSION >= '7.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.tvOSDocset</key>
      <string>10.9.0.0.1.1449203766</string>
    </dict>
    <key>RequiresADCAuthentication</key>
    <false/>
    <key>Summary</key>
    <string>My description of content</string>
  </dict>
  <key>version</key>
  <string>91.5</string>
</dict>
<!-- END tvOS doc set -->
<!-- END Xcode 7.2 FCS -->

每个dict节点,对应一个文件,这里一共有5个,分别是

列表 文档环境版本 Xcode 7.2 FCS

名称 版本 详细版本 描述 链接
DevToolsDocset 5.0 10.9.0.0.1.1449203766 Xcode 7.2 Documentation https://devimages.apple.com.edgekey.net/docsets/20151208/031-43201-A.dmg
iOSDocset 7.0 10.9.0.0.1.1449203766 iOS 9.2 Documentation https://devimages.apple.com.edgekey.net/docsets/20151208/031-43202-A.dmg
OSXDocset 10.9 10.9.0.0.1.1449203766 OS X 10.11.2 Documentation https://devimages.apple.com.edgekey.net/docsets/20151208/031-43203-A.dmg
WatchOSDocset 1.0 10.9.0.0.1.1449203766 watchOS 2.0 Documentation https://devimages.apple.com.edgekey.net/docsets/20151208/031-43204-A.dmg
tvOSDocset 1.0 10.9.0.0.1.1449203766 tvOS 9.1 Documentation https://devimages.apple.com.edgekey.net/docsets/20151208/031-43205-A.dmg

文档都非常大,下载你用到的

比如下载 iOS 9.2 的文档,下载地址

开启迅雷什么的快一点

安装文档并在 Dash 内显示

/Users/YourUserName/Library/Application Support/Dash/DocSets

如果下载后,为安装文件 .pkg 则安装后,在Finder里搜索 .docset

11126234.png

移动到目标目录即可

建议通过Dash管理所有的开发文档

6131500.png

也可以点击 Docsets 右边的感叹圈,显示文档文件位置

210012312.png

For Fun

这下可以安心离线查找文档了,再也不担心太慢了,文档中的英文可以使用触摸板功能 三指轻拍 来快速查询

没有设置的去 系统偏好设置 触控板 查找与数据检测器 中设置快速字典

上一篇下一篇

猜你喜欢

热点阅读