Last active
February 6, 2024 12:13
-
-
Save djromero/5dce571a1a40e8bd07f3 to your computer and use it in GitHub Desktop.
Download and install a single iOS provisioning profile for Xcode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Download and install a single iOS provisioning profile | |
# Requires https://github.com/nomad/cupertino | |
# | |
# Usage | |
# - Login to your account once: | |
# ios login | |
# - Configure TEAM and PROFILE (instructions below) | |
# - Run update_provisioning_profile.sh at anytime, usually after adding/removing devices to the profile | |
# Configure the team identifier | |
# Copy it from developer portal or just use cupertino to get it: | |
# ios devices | |
# Copy the string in parens and set it as TEAM | |
TEAM="team id" | |
# Configure the profile name you want to manage | |
# Copy it from developer portal or use cupertino to get a list (ignoring Xcode managed profiles): | |
# ios profiles --team ${TEAM} | grep -v 'iOS Team Provisioning Profile' | |
# Copy the name as-is and set as PROFILE | |
PROFILE="profile name" | |
# Fetch the profile using `cupertino` tool | |
# you need to run `ios login` once to setup the account | |
ios profiles:download "${PROFILE}" --team ${TEAM} | |
PROFILE_FILE=`echo $PROFILE | tr ' ' '_'` # `cupertino` tool will replace spaces with _ | |
UUID=`/usr/libexec/PlistBuddy -c 'Print :UUID' /dev/stdin <<< $(security cms -D -i ${PROFILE_FILE}.mobileprovision)` | |
# copy where Xcode can find it | |
cp ${PROFILE_FILE}.mobileprovision "$HOME/Library/MobileDevice/Provisioning Profiles/${UUID}.mobileprovision" | |
# clean | |
rm ${PROFILE_FILE}.mobileprovision |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment