Skip to content

Instantly share code, notes, and snippets.

@matiassingers
Created November 20, 2014 15:31
Show Gist options
  • Save matiassingers/47663489189abfc8b2a9 to your computer and use it in GitHub Desktop.
Save matiassingers/47663489189abfc8b2a9 to your computer and use it in GitHub Desktop.
#!/bin/bash
# unzip the .ipa file
unzip -q "$1"
# Default information
displayName=`/usr/libexec/PlistBuddy -c "Print CFBundleDisplayName" Payload/*/Info.plist`
bundleIdentifer=`/usr/libexec/PlistBuddy -c "Print CFBundleIdentifier" Payload/*/Info.plist`
versionName=`/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" Payload/*/Info.plist`
versionCode=`/usr/libexec/PlistBuddy -c "Print CFBundleVersion" Payload/*/Info.plist`
facebookAppId=`/usr/libexec/PlistBuddy -c "Print FacebookAppID" Payload/*/Info.plist`
# Mobile provisioning information
# Create temp .plist file for the Mobile Provisioning profile
security cms -D -i Payload/*/embedded.mobileprovision > Payload/Provision.plist
# I should really just be iterating through all these, but not sure how-to
ApplicationIdentifierPrefix=`/usr/libexec/PlistBuddy -c "Print :ApplicationIdentifierPrefix:0" Payload/Provision.plist`
CreationDate=`/usr/libexec/PlistBuddy -c "Print :CreationDate" Payload/Provision.plist`
ExpirationDate=`/usr/libexec/PlistBuddy -c "Print :ExpirationDate" Payload/Provision.plist`
Name=`/usr/libexec/PlistBuddy -c "Print :Name" Payload/Provision.plist`
UUID=`/usr/libexec/PlistBuddy -c "Print :UUID" Payload/Provision.plist`
TeamIdentifier=`/usr/libexec/PlistBuddy -c "Print :TeamIdentifier:0" Payload/Provision.plist`
TeamName=`/usr/libexec/PlistBuddy -c "Print :TeamName" Payload/Provision.plist`
TimeToLive=`/usr/libexec/PlistBuddy -c "Print :TimeToLive" Payload/Provision.plist`
# iterate please
applicationIdentifier=`/usr/libexec/PlistBuddy -c "Print :Entitlements:application-identifier" Payload/Provision.plist`
apsEnvironment=`/usr/libexec/PlistBuddy -c "Print :Entitlements:aps-environment" Payload/Provision.plist`
getTaskAllow=`/usr/libexec/PlistBuddy -c "Print :Entitlements:get-task-allow" Payload/Provision.plist`
keychainAccessGroup=`/usr/libexec/PlistBuddy -c "Print :Entitlements:keychain-access-groups:0" Payload/Provision.plist`
echo ""
(echo "Display name| $displayName"; \
echo "Bundle identifer| $bundleIdentifer"; \
echo "Version| $versionName ($versionCode)"; \
echo "Facebook App ID| $facebookAppId"; \
echo " | "; \
echo " | "; \
echo "Name| $Name"; \
echo "ApplicationIdentifierPrefix| $ApplicationIdentifierPrefix"; \
echo "UUID| $UUID"; \
echo "TeamIdentifier| $TeamIdentifier"; \
echo "TeamName| $TeamName"; \
echo "TimeToLive| $TimeToLive"; \
echo "Entitlements| application-identifier: $applicationIdentifier"; \
echo " | aps-environment: $apsEnvironment"; \
echo " | get-task-allow: $getTaskAllow"; \
echo " | keychain-access-group: $keychainAccessGroup"; \
echo "CreationDate| $CreationDate"; \
echo "ExpirationDate| $ExpirationDate"; \
) | column -t -s '|'
echo ""
rm -rf Payload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment