Skip to content

Instantly share code, notes, and snippets.

@kezzico
Last active September 5, 2023 18:55
Show Gist options
  • Save kezzico/03adfe624263007e2487c52894c363ee to your computer and use it in GitHub Desktop.
Save kezzico/03adfe624263007e2487c52894c363ee to your computer and use it in GitHub Desktop.

Print all Provisioning Profiles

This script is useful for debugging code signing related build issues. Sometimes numerous provisioning profiles can interfere with each other. By identifying provisioning profiles present on the system, an engineer can deduce where a problem/conflict may occur.

The script prints out the filename of all provisioning profiles on the system along with the actual provisioning profiles name.

Sample output:

4d6f17a7-945c-4e56-a838-feac55a09521.mobileprovision >> CS429UH28N.com.choco.bar
58c1f8c3-1c43-4ae7-8d97-6f1d579ba5e1.mobileprovision >> 5Y399WZH5J.com.multivision.presto
666d535a-31b8-4c04-b3df-3a933553a89d.mobileprovision >> NBK3YU58M8.com.goodsteak.mobile

dependencies

All dependencies are part of the default MacOS system.

script

profiles_dir=~/Library/MobileDevice/Provisioning\ Profiles

plistbuddy=/usr/libexec/PlistBuddy

for file in $profiles_dir/*; do
  prov_profile_name=`$plistbuddy -c 'Print :Entitlements:application-identifier' /dev/stdin <<< $(security cms -D -i "$file")_`

  basename=`basename "$file"`

  echo "$basename >> $prov_profile_name";
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment