I am trying to create automated build for Xcode. Till now everything is working just fine. For building the project from command line I am using this command
xcodebuild –project {“xcode_project file path”}–target {“target_name”} –sdk iphoneos –
configuration Release clean build CODE_SIGN_IDENTITY={$distribution_signing Identity}
PROVISIONING_PROFILE={UUID for provisioning profile}
I want to fetch the UUID and CODE_SIGN_IDENTITY dynamically,
for UUID I am doing
UUID=$(grep "<key>UUID</key>" "$PROVISIONING_PROFILE_PATH" -A 1 --binary-files=text | sed -E -e "/<key>/ d" -e "s/(^.*<string>)//" -e "s/(<.*)//")
Above script code gives me the UUID of any provisioning profile.
I am stuck at getting the CODE_SIGN_IDENTITY dynamically.
I know it is of the form like iPhone Distribution: Developer name
How do I extract iPhone Distribution: Developer name
from a .p12 file.