Skip to content

Instantly share code, notes, and snippets.

@funky-monkey
Forked from niw/show_ipa_metadata.sh
Created November 30, 2015 16:09
Show Gist options
  • Save funky-monkey/21d06b840096f6202b33 to your computer and use it in GitHub Desktop.
Save funky-monkey/21d06b840096f6202b33 to your computer and use it in GitHub Desktop.
Extract iTunesMetadata.plist from ipa file, read it and dump it.
#!/usr/bin/env bash
TEMP_PLIST=/tmp/metadata.plist
for i in "$@"; do
if unzip -p "$i" iTunesMetadata.plist >"$TEMP_PLIST"; then
name=$(/usr/libexec/PlistBuddy -c 'Print :itemName' "$TEMP_PLIST")
id=$(/usr/libexec/PlistBuddy -c 'Print :itemId' "$TEMP_PLIST")
appleid=$(/usr/libexec/PlistBuddy -c 'Print :appleId' "$TEMP_PLIST" 2>/dev/null ||
/usr/libexec/PlistBuddy -c 'Print :com.apple.iTunesStore.downloadInfo:accountInfo:AppleID' "$TEMP_PLIST" 2>/dev/null ||
echo "unknown")
echo "$name\t$id\t$appleid"
rm "$TEMP_PLIST"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment