Over the air deployment is based on a new command in the build menu of Xcode called “build and archive” which packages the application with an embedded provisioning profile.
There have been many questions on how to integrate this feature in a continuous integration process.
The “xcodebuild” command is well known : it builds an Xcode project from the command line and generates an “.app” file.
You can use this command to build your application from a script ran by a software factory.
But the generated file cannot be distributed over the air since it misses the embedded provisioning profile.
We need to build the project into an “.ipa” file, containing the provisioning profile and signed with your developper identity.
To be able to find the command line, the trick was to watch the system console log while running a “build and archive” through Xcode.
Script
OCTO talks
There have been many questions on how to integrate this feature in a continuous integration process.
The “xcodebuild” command is well known : it builds an Xcode project from the command line and generates an “.app” file.
You can use this command to build your application from a script ran by a software factory.
But the generated file cannot be distributed over the air since it misses the embedded provisioning profile.
We need to build the project into an “.ipa” file, containing the provisioning profile and signed with your developper identity.
To be able to find the command line, the trick was to watch the system console log while running a “build and archive” through Xcode.
#!/bin/sh # build.sh # # Created by Vincent Daubry on 19/01/10. # Copyright 2010 OCTO. All rights reserved. PROJDIR=${WORKSPACE}/___PROJECT NAME___ PROJECT_NAME=___XCODE PROJECT NAME___ TARGET_SDK="iphonesimulator4.0" PROJECT_BUILDDIR="${PROJDIR}/build/Release-iphoneos" TARGET_TEST_NAME="UnitTests" BUILD_HISTORY_DIR="/Users/barbu/Desktop" DEVELOPER_NAME="iPhone Developer: M VINCENT DAUBRY (J9TS3TJRYX)" PROVISONNING_PROFILE = "/Users/barbu/Desktop/desire.mobileprovision" # compile project echo Building Project cd "${PROJDIR}" xcodebuild -target "${PROJECT_NAME}" -sdk "${TARGET_SDK}" -configuration Release #Check if build succeeded if [ $? != 0 ] then exit 1 fi /usr/bin/xcrun -sdk iphoneos PackageApplication -v "${PROJECT_BUILDDIR}/${APPLICATION_NAME}.app" -o "${BUILD_HISTORY_DIR}/${APPLICATION_NAME}.ipa" --sign "${DEVELOPER_NAME}" --embed "${PROVISONNING_PROFILE}"
Script
OCTO talks
Comments
Post a Comment