I wrote a script that uses xcodebuild
to generate an AdHoc build of an iPhone application.
I would like to edit this script to output the name of the Provisioning Profile used to sign the build.
This would allow me to include the Provisioning Profile in the zip that is automatically generated. This way, I could automatically send the archive to the AdHoc testers and be sure that they have the right Provisioning Profile to install the app.
Is there any way to extract the Provisioning Profile name or file used to sign the application:
- from the builded and signed application
- from the Xcode project (I don't want to manually parse the project.pbxproj file, as this solution might break in the next Xcode update)
- any other way that is scriptable
Unforgiven suggested to use the command security
to get the name of the certificate used to sign the app. Once you have this information, is there any way to then find the name of the Provisioning Profile?
Here is what I tried:
Sadly, the output of xcodebuild during the build does not contain this information. During the CodeSign step, there is the line:
/usr/bin/codesign -f -s "iPhone Distribution: My name" ...
but I can't match this with a certificate.
I looked into using codesign, and the command
/usr/bin/codesign -d -vvv --entitlements - -r - /Users/lv/Desktop/TicTacBoo.app/TicTacBoolooked promising, but it doesn't give me the information I need.
I haven't found any useful option in xcodebuild either.