Created
February 27, 2013 17:10
-
-
Save subdigital/5049635 to your computer and use it in GitHub Desktop.
Script to install provisioning profiles on a build server
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 | |
# Takes a provisioning profile and installs it into the system path. | |
# This requires poking inside the provisioning profile and searching for the | |
# UUID present at the end of the file. | |
set -e | |
if [[ -z "$1" ]] | |
then | |
echo "USAGE: install_provisioning_profile PROVISIONING_FILE" | |
exit 1 | |
fi | |
if [[ ! -f $1 ]] | |
then | |
echo "The file $1 does not exist" | |
exit 1 | |
fi | |
mobile_provisioning_file=$1 | |
echo "Processing $mobile_provisioning_file" | |
uuid=`grep "UUID" -A1 -a "$mobile_provisioning_file" | grep -o "[-A-Z0-9]\{36\}"` | |
echo "uuid is $uuid" | |
if [[ -z "$uuid" ]] | |
then | |
echo "UUID could not be found in $mobile_provisioning_file" | |
exit 1 | |
fi | |
destination="$HOME/Library/MobileDevice/Provisioning Profiles/$uuid.mobileprovision" | |
cp $mobile_provisioning_file "$destination" | |
echo "Installed to $destination" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Xcode: 11.3
The script is not working as the
grep "UUID" -A1 -a "$mobile_provisioning_file" | grep -o "[-A-Z0-9]\{36\}"
command is not returning anything.Please replace it with
security cms -D -i ${mobile_provisioning_file} | grep -aA1 UUID | grep -o "[-a-zA-Z0-9]\{36\}"