Skip to content

Instantly share code, notes, and snippets.

@Temikus
Created July 24, 2013 05:32
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 Temikus/6068264 to your computer and use it in GitHub Desktop.
Save Temikus/6068264 to your computer and use it in GitHub Desktop.
#! /bin/bash
#Retrieve the list of devices, an IPA file was built for by parsing the embedded.mobileprovision.
[[ -n "$1" ]] || { echo "Usage: ./check_devs.sh sample.ipa"; exit 0 ; }
LANG=C
IPAFILE=$1
TMPDIR=tmp$$.tmp
mkdir $TMPDIR
unzip -qq $IPAFILE -d $TMPDIR
EMBEDFILE=`find $TMPDIR -name embedded.mobileprovision -print | head -1`
EMBEDFILEONLY=$EMBEDFILE.plist
sed -n '/plist/,/\/plist/p' $EMBEDFILE > $EMBEDFILEONLY
sed -n '/ProvisionedDevices/,/\/array/p' $EMBEDFILEONLY | grep string | sed 's/<[/]*string>//g'
rm -rf $TMPDIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment