Skip to content

Instantly share code, notes, and snippets.

@yourtion
Created June 27, 2017 07:47
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yourtion/ea64606774299581501eabed51e99fe2 to your computer and use it in GitHub Desktop.
Save yourtion/ea64606774299581501eabed51e99fe2 to your computer and use it in GitHub Desktop.
Get mobile uuid from mobileprovision file path
#!/bin/bash
if [ $# -ne 1 ]
then
echo "Usage: getmobileuuid the-mobileprovision-file-path"
exit 1
fi
# mobileprovision_uuid=`grep UUID -A1 -a $1 | grep -o "[-A-Z0-9]\{36\}"`
mobileprovision_uuid=`/usr/libexec/PlistBuddy -c "Print UUID" /dev/stdin <<< $(/usr/bin/security cms -D -i $1)`
echo "UUID is:"
echo ${mobileprovision_uuid}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment