Parsing mobileprovision files in bash?

egiray picture egiray · Jun 18, 2011 · Viewed 13.3k times · Source

I am tying building a php/bash/mysql system for automating adhoc distribution for iPhone apps. But I want to read the application-identifier key in mobileprovision file of projects and change it info.plist file according to that.

I can currently build ipa files from php IF the cfbundleidentifer key is same as its provision file.

I found a code like this https://gist.github.com/711794 but I want bash script to integrate it to my system.

Thanks

Answer

jlawrie picture jlawrie · May 8, 2012

If your running this on a machine with mac os x, you can use the following:

/usr/libexec/PlistBuddy -c 'Print :Entitlements:application-identifier' /dev/stdin <<< $(security cms -D -i path_to_mobileprovision)