Skip to content

Instantly share code, notes, and snippets.

@niw
Last active January 16, 2020 11:33
Show Gist options
  • Save niw/5971209 to your computer and use it in GitHub Desktop.
Save niw/5971209 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