A command line tool for Mac OS X that downloads sales reports from iTunes Connect.
Objective-C Makefile HTML Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Autoindigestion.xcodeproj
Documentation
Installer Updated project to latest recommended Xcode settings. Jan 5, 2016
Source
UnitTests
.gitignore
LICENSE
README.md Added CDATA markers to values in example vendor file. Oct 5, 2013

README.md

Autoindigestion

Autoindigestion is a command line tool for Mac OS X that downloads all available sales reports from iTunes Connect. It uses the Auto-Ingest tool supplied by Apple to download individual reports.

Autoindigestion can be configured to work with multiple iTunes Connect vendors. When Autoindigestion runs, it will look for vendor files, which are standard XML plists that contain vendor information, including iTunes Connect sign in credentials. For security, it is recommended that each vendor create a separate iTunes Connect user limited to the Sales role for use with Autoindigestion.

Autoindigestion is available under a BSD-style open source license. See the LICENSE file for details.

System Requirements

Autoindigestion is developed on Mac OS X 10.8 Mountain Lion using Xcode 5.0. It is a modern Objective-C command line tool. The current distribution is source only, so a Mac running Mountain Lion with Xcode installed is required. The Xcode project now includes a target for building a standard Mac installer package. (A pre-built, signed installer package is planned for the future.)

Autoindigestion also depends on Apple's Auto-Ingest tool, a Java class available from Apple at http://www.apple.com/itunesnews/docs/Autoingestion.class.zip. The installer package will automatically download the latest version of the Auto-Ingest tool from Apple. Java is needed to run the Auto-Ingest tool, but is no longer installed on Mac OS X by default. You can download the latest Java installer from Apple at http://support.apple.com/downloads/#Java.

Installation

After downloading the source, open Autoindigestion.xcodeproj in Xcode then build the installer package by selecting the Installer scheme in the Product | Scheme menu, then choosing Product | Build or Product | Run. If you run the Installer scheme from Xcode, the Autoindigestion installer will launch automatically after it is built. To locate the installer package file, right click on the Autoindigestion.pkg entry in the Xcode project and select Show in Finder.

Manual Installation and Removal

The Autoindigestion installer creates the following directories and files:

  • /Library/Autoindigestion/Autoindigestion
  • /Library/Autoindigestion/Autoingestion.class
  • /Library/Autoindigestion/Vendors/ExampleVendor.plist
  • /Library/LaunchDaemons/Autoindigestion.plist
  • /usr/local/share/man/man1/Autoindigestion.1
  • /usr/local/share/man/man5/Autoindigestion.5

In addition, the installer creates a temporary directory named /tmp/com.ablepear.autoindigestion.installer/ and will remove it when installation is completed under normal circumstances.

Configuration

Create at least one vendor file in /Library/Autoindigestion/Vendors. A vendor filename must end in .plist. Here is an example vendor file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" 
    "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>VendorName</key>
    <string><![CDATA[Example Inc]]></string>

    <key>VendorID</key>
    <string>81234567</string>

    <key>Username</key>
    <string><![CDATA[someone@example.com]]></string>

    <key>Password</key>
    <string><![CDATA[itsasecret]]></string>
</dict>
</plist>

Because this is an XML file, it's recommended that you surround the vendor name, username and password values with <![CDATA[ and ]]>; alternately you need to check these values for special XML characters <, > and & and replace them with &lt;, &gt; and &amp; respectively.

The installer will create a similar example vendor file at /Library/Autoindigestion/Vendors/ExampleVendor.plist. The vendor ID is available in iTunes Connect on the "Sales and Trends" page or can be found in an existing sales report. For security, do not use the username and password of your iTunes Connect Admin user in the vendor file! Create a separate iTunes Connect user limited to the Sales role for use with Autoindigestion. For additional security, run chmod 600 "<vendor file>" and sudo chown root:admin "<vendor file>" on each vendor file you create.

The installer creates and loads a launchd item at /Library/LaunchDaemons/Autoindigestion.plist that will run Autoindigestion automatically each day. Here is a sample launchd item that runs at 8:30 AM in the morning and again at 8:30 PM in the evening:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
        "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>Autoindigestion</string>

    <key>ProgramArguments</key>
    <array>
        <string>/Library/Autoindigestion/Autoindigestion</string>
    </array>

    <key>StartCalendarInterval</key>
    <array>
        <dict>
            <key>Hour</key>
            <integer>8</integer>
            <key>Minute</key>
            <integer>30</integer>
        </dict>
        <dict>
            <key>Hour</key>
            <integer>20</integer>
            <key>Minute</key>
            <integer>30</integer>
        </dict>
    </array>

    <key>StandardErrorPath</key>
    <string>/Library/Logs/Autoindigestion.log</string>

    <key>StandardOutPath</key>
    <string>/Library/Logs/Autoindigestion.log</string>
</dict>
</plist>

You may want to adjust the run time based on your time zone. iTunes Connect reports are usually available by 8:00 AM Cupertino time (UTC -0800 or -0700 in summer) but are occasionally delayed a few hours.

After creating or modifying the launchd item, tell launchd to load it by running sudo launchctl load /Library/LaunchDaemons/Autoindigestion.plist.

To disable Autoindigestion, run sudo launchctl unload /Library/LaunchDaemons/Autoindigestion.plist.

Downloaded reports for each vendor will be placed in /Users/Shared/iTunes Connect/<VendorName> respectively, where <VendorName> is the value of the VendorName key from the vendor file.

Reference

See the Autoindigestion command man page for complete details on the Autoindigestion command. For more information on Autoindigestion configuration files, see the Autoindigestion file formats man page.

For details on Apple's Auto-Ingest tool and complete information about the iTunes Connect report format, log into iTunes Connect, go to "Sales and Trends" and click on the "Download User Guide" link near the bottom of the page to download the "iTunes Connect Sales and Trends Guide" PDF file. Note that there are different guides for vendors of apps, music, video and books.