Just An Application

September 19, 2014

The Arcane World Of Xcode 6.0 Downloadable DocSets: Part Three — Xcode 6.0.1 And The Invisible iOS 8.0 Documentation

If you download the iOS 8.0 documentation via the Downloads tab of the Preferences panel in Xcode 6.0.1 you end up with a package

    com.apple.adc.documentation.AppleiOS8.0.iOSLibrary.docset

and the files

    Library/Receipts/com.apple.pkg.7.0.iOSDocset.bom

and

    Library/Receipts/com.apple.pkg.7.0.iOSDocset.plist

in the directory

   ~/Library/Developer/Shared/Documentation/DocSets

What you don't end up with is any visible iOS 8.0 documentation if you are offline.

The com.apple.pkg.7.0.iOSDocset.plist file in the

   ~/Library/Developer/Shared/Documentation/DocSets/Library/Receipts

directory looks like this

    {
      "InstallPrefixPath" => "/"
      "PackageFileName" => "iOSDocset.pkg"
      "InstallDate" => 2014-09-18 11:05:09 +0000
      "PackageIdentifier" => "com.apple.pkg.7.0.iOSDocset"
      "PackageVersion" => "10.9.0.0.1.1405962775"
      "PackageGroups" => [
        0 => "com.apple.snowleopard-repair-permissions.pkg-group"
        1 => "com.apple.FindSystemFiles.pkg-group"
      ]
      "InstallProcessName" => "Xcode"
    }

Its presence plus the value of the "PackageVersion" entry meets the criteria for installation as expressed in the entry in the .dvtdownloadable index file.

The Downloads tab in the Preferences panel shows the documentation as downloaded, so the part of Xcode responsible for downloads believes the documentation is installed, but the part of Xcode responsible for displaying it does not.

Comparing the info.plist and version.plist files in the Xcode internal documentation set and the downloaded documentation set turns up the interesting fact that the versions don't match.

The internal documentation set has the version number

    52.28

and the downloaded documentation set has the version number

    52.8

So what happens if you make them match ?

Answer the documentation appears when offline.

It works either way round.

You can change the versions in the Info.plist of the downloaded documentation set to 52.28, or the versions in the Info.plist of the internal documentation set to 52.8.

The other issue is the use of

    com.apple.pkg.7.0.iOSDocset

as the package identifier for the iOS 8.0 documentation set.

Although it does not affect the working of Xcode 6.0.1 it effectively de-installs the iOS 7.0 documentation as far as earlier versions of Xcode are concerned.

It should presumably be

    com.apple.pkg.8.0.iOSDocset

Copyright (c) 2014 By Simon Lewis. All Rights Reserved.

Unauthorized use and/or duplication of this material without express and written permission from this blog's author and owner Simon Lewis is strictly prohibited.

Excerpts and links may be used, provided that full and clear credit is given to Simon Lewis and justanapplication.wordpress.com with appropriate and specific direction to the original content.

The Arcane World Of Xcode 6.0 Downloadable DocSets: Part Two — Documentation Sets

Structure

An Xcode documentation set is a specialized kind of bundle.

At the top-level the Contents directory contains two files

    Info.plist

and

    version.plist

and a single directory

    Resources

The Info.plist contains a set of Bundle specific properties, identifier, name and version, and a set of DocSet specific properties.

The version.plist contains version information.

The Resources directory contains the documentation set metadata e.g., indexes, the table of contents, etc, plus two directories

    Documents

and

    Tokens

Locations

Internal

Documentation sets can be found within an Xcode bundle in the directory

    $(XCODE_BUNDLE)/Contents/Developer/Documentation/DocSets

By default these documentation sets contain the metadata and the tokens but no actual documentation, i.e., the Documents directory is empty.

Instead the documentation is accessed over the net as required.

External

Versions of the documentation sets contained within the Xcode bundle which contain all of the actual documentation as well as the metadata and tokens can be downloaded.

These versions are installed in the directory

   ~/Library/Developer/Shared/Documentation/DocSets

The presence of a documentation set external to the Xcode bundle containing the full documentation will cause Xcode to use the documentation from that documentation set when necessary rather than accessing it over the net.


Copyright (c) 2014 By Simon Lewis. All Rights Reserved.

Unauthorized use and/or duplication of this material without express and written permission from this blog's author and owner Simon Lewis is strictly prohibited.

Excerpts and links may be used, provided that full and clear credit is given to Simon Lewis and justanapplication.wordpress.com with appropriate and specific direction to the original content.

Create a free website or blog at WordPress.com.