The way to avoid this is to build an IPA file which is the format that iTunes on both OS X and Windows store downloaded applications in. Basically the format is just a zip file with a specific directory structure and an ".ipa" extension instead of the normal ".zip" extension. Since it's just a single file whether you're using a Mac or Windows, it makes everything equally simple for everyone.
So it's not too hard to create an IPA file, but Xcode won't do it for you by default or using any built-in target templates. Luckily it's not that hard to get it to work.
A guy posted some instructions here on how to do this, but his build script was a little too hard-coded for me, so I improved on it a bit:
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
These modifications allow you to just copy the script into any project without having to modify the script with the project name and such. Otherwise just follow his instructions.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
You may also want to add the input and output files to support the dependency freshness checking stuff in the build system. This helps to ensure that a new IPA file doesn't get built from an old application bundle.
1 comments:
This was very useful in stream lining my app development process.
Thanks a bunch
Post a Comment