Site file layout
- name.com/index.php (iPhone website, optional but recommended)
- name.com/application/index.php(the main site for creating automatic links)
- name.com/application/application.ipa (only the file that needs to be updated)
- name.com/application/application.plist
- name.com/application/application57.png
- name.com/application/application512.png
- name.com/application/Application_Distribution_Profile.mobileprovision
Solution using Automator:
First step: run the Script shell to create and archive and save it in a .ipa file. It may take some time to figure out how to change this to fit your situation, just like with me (this may not work with Xcode 4, and if you have problems just create and archive inside Xcode)
PROJDIR="/Users/username/Xcode/applicationfolder" PROJECT_NAME="application" APPLICATION_NAME="Application" TARGET_SDK="iphonesimulator4.0" PROJECT_BUILDDIR="${PROJDIR}/build/Distribution-iphoneos" TARGET_TEST_NAME="application" BUILD_HISTORY_DIR="${PROJDIR}/distribution/" #where you want the .ipa to go DEVELOPER_NAME="First Last (TMTE9G3NGS)" PROVISONING_PROFILE="/Users/username/Xcode/Application_Distribution_Profile.mobileprovision" # compile project echo Building Project cd "${PROJDIR}" xcodebuild -target "${PROJECT_NAME}" -sdk "${TARGET_SDK}" -configuration Distribution #Check if build succeeded if [ $? != 0 ] then exit 1 fi /usr/bin/xcrun -sdk iphoneos PackageApplication -v "${PROJECT_BUILDDIR}/${PROJECT_NAME}.app" -o "${BUILD_HISTORY_DIR}/${APPLICATION_NAME}.ipa" --sign "${DEVELOPER_NAME}" --embed "${PROVISONING_PROFILE}"
Step 2. Get the Finder Element
The .ipa file of the application that was just saved.
Step Three: Upload to FTP Server
Google for the script (can not post url) it in automatorworld dot com, though, should be easy to find. Use a script to upload the file to where you want. In my case name.com/application/application.ipa
Now for the end of the website.
If you want the user to have an easy way to download the file, just place the index.php file (created below), the Application.plist file (created below), the .ipa file and the 57-pixel and 512-pixel images in the folder.
I took it a step further and created an iPhone website iPhone, which you can go to, also shows when the file was last updated. You can create this site using this template: http://snipt.org/vmup/ I had to use the main site to copy the URL that it created for links to ipa and mobileprovision. Here is a snippet that I have for a link with an automatic update. Last updated date. For the last updated text to work, I had to change the file to .php
<li><a href="URL FROM BASIC SITE HERE"><span class="menuname">Install Application Name</span><span class="itemarrow"></span></a></li> <sup> Last Updated: <?= date("m/d/YH:i",filemtime("applicationfolder/application.ipa")) ?> (TIME ZONE HERE) <sup>
The basic automatic link that creates the application index file:
<?php $ipas = glob('*.ipa'); $provisioningProfiles = glob('*.mobileprovision'); $plists = glob('*.plist'); $sr = stristr( $_SERVER['SCRIPT_URI'], '.php' ) === false ? $_SERVER['SCRIPT_URI'] : dirname($_SERVER['SCRIPT_URI']) . '/'; $provisioningProfile = $sr . $provisioningProfiles[0]; $ipa = $sr . $ipas[0]; $itmsUrl = urlencode( $sr . 'index.php?plist=' . str_replace( '.plist', '', $plists[0] ) ); if ($_GET['plist']) { $plist = file_get_contents( dirname(__FILE__) . DIRECTORY_SEPARATOR . preg_replace( '/![A-Za-z0-9-_]/i', '', $_GET['plist']) . '.plist' ); $plist = str_replace('_URL_', $ipa, $plist); header('content-type: application/xml'); echo $plist; die(); } ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Install iOS App</title> <style type="text/css"> li { padding: 1em; } </style> </head> <body> <ul> <li><a href="<? echo $provisioningProfile; ?>">Install Team Provisioning File</a></li> <li><a href="itms-services://?action=download-manifest&url=<? echo $itmsUrl; ?>"> Install Application</a></li> </ul> </body> </html>
Plist application 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>items</key> <array> <dict> <key>assets</key> <array> <dict> <key>kind</key> <string>software-package</string> <key>url</key> <string>IPA FILE LINK HERE</string> </dict> <dict> <key>kind</key> <string>full-size-image</string> <key>needs-shine</key> <true/> <key>url</key> <string>URL FOR 512 PIXEL IMAGE HERE</string> </dict> <dict> <key>kind</key> <string>display-image</string> <key>needs-shine</key> <true/> <key>url</key> <string>URL FOR 57 PIXEL IMAGE HERE</string> </dict> </array> <key>metadata</key> <dict> <key>bundle-identifier</key> <string>COM.COMPANY.APPLICATION</string> <key>bundle-version</key> <string>VERSION NUMBER HERE (YOU DON'T REALLY NEED TO UPDATE IT UNLESS YOU WANT TO)</string> <key>kind</key> <string>software</string> <key>title</key> <string>APPLICATION NAME HERE</string> </dict> </dict> </array> </dict> </plist>