Skip to content

Instantly share code, notes, and snippets.

@tehnoir
Created May 18, 2016 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tehnoir/520e61d540363b013c71d4c849112967 to your computer and use it in GitHub Desktop.
Save tehnoir/520e61d540363b013c71d4c849112967 to your computer and use it in GitHub Desktop.
#!/bin/bash
# This script will check an IPA and determine if the specified UDID is in the embedded provisioning profile
IPA=$1
UDID=$2
# Eventually if no UDID is specified, we'll print all UDIDs.
if [ $# -eq "1" ]
then
echo "Please specify a UDID to check for."
elif [ $# -eq "2" ]
then
mkdir -p /tmp/unzippedIPAs
cd /tmp/unzippedIPAs
## Unzip only the embedded.mobileprovision file and pipe to standard output where we can grep for the UDID
unzip -p $IPA Payload/*/embedded.mobileprovision | grep -qo --binary-files=text $UDID; RESULT=$?;
if [ $RESULT -eq 1 ]
then
tput setaf 1
tput bold
echo -e "No Match Found."
tput sgr0
else
tput setaf 2
tput bold
echo "UDID Found!"
tput sgr0
fi
rm -rf /tmp/unzippedIPAs
else
echo "Usage: ./checkipaforudid [IPAName.ipa] [UDID]"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment