Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A small script that uses XCode's Application Loader to automatically submit an IPA to iTunes Connect
set -ex
# Originally from
# This scripts allows you to upload a binary to the iTunes Connect Store and do it for a specific app_id
# Because when you have multiple apps in status for download, xcodebuild upload will complain that multiple apps are in wait status
# Requires application loader to be installed
# See
# Itunes Connect username & password
# App id as in itunes store create, not in your developer account
MD5=$(md5 -q $IPA_FILE)
BYTESIZE=$(stat -f "%z" $IPA_FILE)
# Remove previous temp
test -d ${TEMPDIR} && rm -rf ${TEMPDIR}
mkdir ${TEMPDIR}
mkdir ${TEMPDIR}/mybundle.itmsp
# You can see this debug info when you manually do an app upload with the Application Loader
# It's when you click activity
cat <<EOM > ${TEMPDIR}/mybundle.itmsp/metadata.xml
<?xml version="1.0" encoding="UTF-8"?>
<package version="software4.7" xmlns="">
<software_assets apple_id="$APP_ID">
<asset type="bundle">
<checksum type="md5">$MD5</checksum>
cp ${IPA_FILE} $TEMPDIR/mybundle.itmsp
/Applications/\ -m upload -f ${TEMPDIR} -u "$USER" -p "$PASS" -v detailed

This comment has been minimized.

Copy link

@qnoob92 qnoob92 commented Dec 3, 2018

This is a great script but its old school. Check out altool, it comes with application loader now. Pretty much same thing but you don't have to create the itmsp file, you can give an IPA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment