Parsing mobileprovision files in bash?

Viewed 15540

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

6 Answers

I used the code from mobileprovision-read repository to be able to pull information from the mobileprovision file. This uses macOS APIs to read the file.

Here is the usage from running the generated program:

mobileprovision-read -- mobileprovision files querying tool.

USAGE
mobileprovision-read -f fileName [-o option]

OPTIONS
    type – prints mobileprovision profile type (debug, ad-hoc, enterprise, appstore)
    appid – prints application identifier
Will print raw provision's plist if option is not specified.
You can also use key path as an option.

EXAMPLES
mobileprovision-read -f test.mobileprovision -o type
    Prints profile type

mobileprovision-read -f test.mobileprovision -o UUID
    Prints profile UUID

mobileprovision-read -f test.mobileprovision -o ProvisionedDevices
    Prints provisioned devices UDIDs

mobileprovision-read -f test.mobileprovision -o Entitlements.get-task-allow
    Prints 0 if profile doesn't allow debugging 1 otherwise
Related