Skip to content

Instantly share code, notes, and snippets.

@tehnoir
Created May 18, 2016 21:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tehnoir/33157484e90730f5afd7465931630b05 to your computer and use it in GitHub Desktop.
Save tehnoir/33157484e90730f5afd7465931630b05 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
if [ $# -eq "1" ]
then
echo "Please specify a UDID to check for."
elif [ $# -eq "2" ]
then
mkdir -p /tmp/unzippedIPAs
cd /tmp/unzippedIPAs
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