Find provisioning profile in Xcode 5
XcodeProvisioning ProfileXcode5Xcode Problem Overview
In Xcode 5, I can get list of provisioning profiles under Xcode >> preferences >> accounts >> view details
. I want to copy profile and have to send it to one of my client, but I am not able to right click on it to find it using "Reveal Profile in Finder" option.
How can I get specific provisioning profile in XCode 5 or do I have to download it from developer.apple every time?
Xcode Solutions
Solution 1 - Xcode
I found a way to find out how your provisioning profile is named. Select the profile that you want in the code sign section in the build settings, then open the selection view again and click on "other" at the bottom. Then occur a view with the naming of the current selected provisioning profile.
You can now find the profile file on the path:
~/Library/MobileDevice/Provisioning Profiles
Update:
For Terminal:
cd ~/Library/MobileDevice/Provisioning\ Profiles
Solution 2 - Xcode
check here:
~/Library/MobileDevice/Provisioning Profiles
Solution 3 - Xcode
The following works for me at a command prompt
cd ~/Library/MobileDevice/Provisioning\ Profiles/
for f in *.mobileprovision; do echo $f; openssl asn1parse -inform DER -in $f | grep -A1 application-identifier; done
Finding out which signing keys are used by a particular profile is harder to do with a shell one-liner. Basically you need to do:
openssl asn1parse -inform DER -in your-mobileprovision-filename
then cut-and-paste each block of base64 data after the DeveloperCertificates entry into its own file. You can then use:
openssl asn1parse -inform PEM -in file-with-base64
to dump each certificate. The line after the second commonName in the output will be the key name e.g. "iPhone Developer: Joe Bloggs (ABCD1234X)".
Solution 4 - Xcode
xCode 6 allows you to right click on the provisioning profile under account -> detail (the screen shot you have there) & shows a popup "show in finder".
Solution 5 - Xcode
If it's sufficient to use the following criteria to locate the profile:
<key>Name</key>
<string>iOS Team Provisioning Profile: *</string>
you can scan the directory using awk. This one-liner will find the first file that contains the name starting with "iOS Team".
awk 'BEGIN{e=1;pat="<string>"tolower("iOS Team")}{cur=tolower($0);if(cur~pat &&prev~/<key>name<\/key>/){print FILENAME;e=0;exit};if($0!~/^\s*$/)prev=cur}END{exit e}' *
Here's a script that also returns the first match, but is easier to work with.
#!/bin/bash
if [ $# != 1 ] ; then
echo Usage: $0 \<start of provisioning profile name\>
exit 1
fi
read -d '' script << 'EOF'
BEGIN {
e = 1
pat = "<string>"tolower(prov)
}
{
cur = tolower($0)
if (cur ~ pat && prev ~ /<key>name<\\/key>/) {
print FILENAME
e = 0
exit
}
if ($0 !~ /^\s*$/) {
prev = cur
}
}
END {
exit e
}
EOF
awk -v "prov=$1" "$script" *
It can be called from within the profiles directory, $HOME/Library/MobileDevice/Provisioning Profiles:
~/findprov "iOS Team"
To use the script, save it to a suitable location and remember to set the executable mode; e.g., chmod ugo+x
Solution 6 - Xcode
You can use "iPhone Configuration Utility" to manage provisioning profiles.
Solution 7 - Xcode
I wrote a simple bash script to get around this stupid problem. Pass in the path to a named copy of your provision (downloaded from developer.apple.com) and it will identify the matching GUID-renamed file in your provision library:
#!/bin/bash
if [ -z "$1" ] ; then
echo -e "\nUsage: $0 <myprovision>\n"
exit
fi
if [ ! -f "$1" ] ; then
echo -e "\nFile not found: $1\n"
exit
fi
provisionpath="$HOME/Library/MobileDevice/Provisioning Profiles"
provisions=$( ls "$provisionpath" )
for i in $provisions ; do
match=$( diff "$1" "$provisionpath/$i" )
if [ "$match" = "" ] ; then
echo -e "\nmatch: $provisionpath/$i\n"
fi
done
Solution 8 - Xcode
It is not exactly for Xcode5 but this question links people who want to check where are provisioning profiles:
Following documentation https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingCertificates/MaintainingCertificates.html
- Choose Xcode > Preferences.
- Click Accounts at the top of the window.
- Select the team you want to view, and click View Details.
In the dialog that appears, view your signing identities and provisioning profiles. If a Create button appears next to a certificate, it hasn’t been created yet. If a Download button appears next to a provisioning profile, it’s not on your Mac.
Ten you can start context menu on each profile and click "Show in Finder" or "Move to Trash".