Skip to content

Instantly share code, notes, and snippets.

@akofman
Last active July 28, 2022 14:34
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save akofman/a70a16af27e15cc717e7 to your computer and use it in GitHub Desktop.
Save akofman/a70a16af27e15cc717e7 to your computer and use it in GitHub Desktop.
Check devices in a provisioning profile

After exporting an ipa for Ad Hoc Deployment, it could be useful to check if all authorized devices are well configured in a provisioning profile. To read a provisioning profile you have to unarchive your ipa :

$ unzip your.ipa

find the embedded.mobileprovision file :

$ ls yourUnzippedIpa/Payload/appName.app/embedded.mobileprovision

and then check if an uuid is well configured :

$ security cms -Di yourUnzippedIpa/Payload/appName.app/embedded.mobileprovision | grep uuidYouWantToCheck

That's all !

@mzygar
Copy link

mzygar commented Mar 24, 2017

I've put it together in a script file

#!/bin/bash
#based on https://gist.github.com/akofman/a70a16af27e15cc717e7
if [ "$#" -ne 2 ]; then
    echo "Usage: deviceIncluded <path/to/File.ipa> <device UDID to check>"
    exit 1
fi

ipaFile=$1
deviceUDID=$2

unzip -q ${ipaFile} -d /tmp/unzippedIpa/
project=`ls /tmp/unzippedIpa/Payload/`
security cms -Di /tmp/unzippedIpa/Payload/"${project}"/embedded.mobileprovision | grep ${deviceUDID}
rm -rf /tmp/unzippedIpa

Thanks for the gist, it saved me quite some time

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