106

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?

enter image description here

Ankur
  • 5,086
  • 19
  • 37
  • 62
  • Use this solution for Xcode 5! http://stackoverflow.com/a/18504418/1463604 – Nishant Dec 17 '13 at 17:30
  • Possible duplicate of [Provisioning Profiles menu item missing from Xcode 5](http://stackoverflow.com/questions/18041267/provisioning-profiles-menu-item-missing-from-xcode-5) – Simon East Feb 15 '16 at 05:00

8 Answers8

224

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
extempl
  • 2,987
  • 1
  • 26
  • 38
matzino
  • 3,544
  • 1
  • 18
  • 37
  • 9
    For terminal: `cd ~/Library/MobileDevice/Provisioning\ Profiles` – tsafrir Sep 03 '15 at 06:29
  • 1
    to find auto generated profiles use `grep -l "iOSTeam Provisioning Profile: com.your.bundle.id." *` – tsafrir Sep 03 '15 at 06:31
  • 1
    Is it possible to change the default location of profile ..? How to tell xcode use the profile from other location when we build using "xcodebuild" command line tool..? – Sreedhar GS Feb 02 '17 at 06:29
  • `For terminal: cd ~/Library/MobileDevice/Provisioning\ Profiles` musth be highlighted thanks @tsafrir – Ashok R Feb 17 '17 at 02:34
30

check here:

~/Library/MobileDevice/Provisioning Profiles
Ryan Copley
  • 873
  • 1
  • 10
  • 26
yasirmturk
  • 1,924
  • 2
  • 22
  • 32
  • 8
    the provisioning profile files are readable in a text editor so you can just open the files in this directory in a text editor, e.g. `open -a TextEdit /Users/$(whoami)/Library/MobileDevice/Provisioning\ Profiles/4A733DA3-07E3-43A3-9AB2-2D25070153EB.mobileprovision` and seach for "**Name**" to find profile's name as it appears on Apple Member Center or in Xcode account preferences. – jhavatar Oct 22 '13 at 09:43
18

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)".

user23614
  • 566
  • 4
  • 4
14

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".

user2962499
  • 486
  • 6
  • 10
9

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

bvj
  • 3,294
  • 31
  • 30
  • 2
    Great stuff. Just add `cd "${HOME}/Library/MobileDevice/Provisioning Profiles/"` before the awk command, and you can call it from anywhere you want. – onekiloparsec Apr 08 '14 at 09:28
6

You can use "iPhone Configuration Utility" to manage provisioning profiles.

ChenXin
  • 373
  • 5
  • 26
  • "iPhone Configuration Utility" is superseded by ["Apple Configurator"](https://itunes.apple.com/app/apple-configurator/id434433123?mt=12) – mahal tertin Jun 27 '14 at 12:27
  • but Apple Configurator does not auto-locate Provisioning Profiles, as iPhone Configuration Utility does. – Raptor Aug 08 '14 at 02:25
6

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
user1467074
  • 61
  • 1
  • 2
3

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

  1. Choose Xcode > Preferences.
  2. Click Accounts at the top of the window.
  3. Select the team you want to view, and click View Details. enter image description here 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. enter image description here

Ten you can start context menu on each profile and click "Show in Finder" or "Move to Trash".

Community
  • 1
  • 1
pbaranski
  • 22,778
  • 19
  • 100
  • 117