With this tutorial, you can get an ipa file directly which can be installed on any one’s iphone or itouch for testing.

Steps:



1.      In your Xcode project expand the Targets item and control-click ( or right click if using a multi button mouse ) and select Add->New Target and select “Other” at the bottom left and choose the Aggregate option similar to this:

aggregatetarget



2.     And name the new target IPA:

ipa

ps. Helloworld is your original Xcode project.


3.    On the next screen be sure the add HelloWord target as a direct dependency by clicking the plus button in the lower right corner under the Direct Dependencies section like this:

ipa_dependency



4.    Close this window once you are done adding HelloWorld target as a direct dependency of IPA target. Right click or control-click on the IPA target and select the Add->New Build Phase->New Run Script Build Phase menu item and add the following code:

# compress application.

payload_dir=”$CONFIGURATION_BUILD_DIR/Payload”
app_bundle_dir=”$CONFIGURATION_BUILD_DIR/${PROJECT_NAME}.app”
/bin/rm -rf “$payload_dir”
/bin/mkdir “$payload_dir”
/bin/cp -R “$app_bundle_dir” “$payload_dir”
/bin/cp iTunesArtwork “$CONFIGURATION_BUILD_DIR/iTunesArtwork”
cd “$CONFIGURATION_BUILD_DIR”
/usr/bin/zip -r “${PROJECT_NAME}.ipa” Payload iTunesArtwork
rm -rf “$payload_dir” iTunesArtwork

payload_dir=”$CONFIGURATION_BUILD_DIR/Payload”app_bundle_dir=”$CONFIGURATION_BUILD_DIR/${PROJECT_NAME}.app”/bin/rm -rf “$payload_dir”/bin/mkdir “$payload_dir”/bin/cp -R “$app_bundle_dir” “$payload_dir”/bin/cp iTunesArtwork “$CONFIGURATION_BUILD_DIR/iTunesArtwork”cd “$CONFIGURATION_BUILD_DIR”/usr/bin/zip -r “${PROJECT_NAME}.ipa” Payload iTunesArtworkrm -rf “$payload_dir” iTunesArtwork

The run script window should look like this:

ps. iTunesArtwork(do not change this) is the name of your image file(512 × 512 jpg) which will appear on itunes when you sync the app.


5.    Now you can choose to run the IPA target instead of the HelloWorld target to compile the application and turn it into HelloWorld.ipa file that your users can bring directly into iTunes simply by double clicking on it.

chooseipatarget

In the directory where you apps are built, you should find a file called HelloWorld.ipa:

debug-iphoneos

This also works on lastest iphone OS version 3.1.3

Advertisements