4 echo "Usage: $0 \<app_bundle_name\>"
5 echo "The following environment variables must be set:"
6 echo " CODE_SIGN_PROFILE - name of provisioning profile to use, without .mobileprovision suffix."
7 echo " CODE_SIGN_ENTITY - name of developer certificate in the keychain."
11 profile_pathname
=~
/Library
/MobileDevice
/Provisioning\ Profiles
/$CODE_SIGN_PROFILE.mobileprovision
13 if [ ! -f "$profile_pathname" ]; then
14 echo "ERROR: Provisioning profile $CODE_SIGN_PROFILE not found"
18 echo Embedding provisioning profile...
19 cp -f "$profile_pathname" "$1/embedded.mobileprovision"
21 echo Creating code signature...
22 codesign
-f -s "$CODE_SIGN_ENTITY" --resource-rules=$1/ResourceRules.plist
--entitlements Entitlements.plist
$1