Mac: How to Correctly Import "Provisioning Profile" or Certificate into Keychain Access

1.9k Views Asked by At

I've been working in mobile development for about seven years now and deploying to iOS devices has always been the bane of my existence. One of the most annoying elements is waiting on a 20 minute build - only to hit a "build failed" error (at the end of that 20 minute build) in xcode because something isn't properly configured - typically the provisioning profile.

I'm going to answer this question because I believe I've finally found a fool-proof way of deploying to iOS that circumvents the need to be an admin on your Mac or, as in my case, even if you are an admin on your Mac - because you don't have the credentials of the first person who happened to set up your machine.

What can happen is you'll import the certificate/provisioning-profile, finish your build and then be presented with a dialog like this:

System Credentials Dialog That May Reject Your Account Credentials

In my case - more often than not - the Mac I'm using will not accept my credentials - even though I'm an admin on this system.

1

There are 1 best solutions below

0
On

To correctly import the certificate - find the ".p12" file, open the "Keychain Access" application, ensure you have "login" selected in the "Keychains" section + "My Certificates" selected in the "Category" section.

Now click on "File" and then "Import Items", select the ".p12" certificate file, enter its password (if it is password protected) and then you'll be asked to enter your "login" password with a dialog like the following:

Enter your login password

Once you've completed this step - you'll be able to build to your iOS device using xcode - unless of course you hit one of the other myriad of issues that crops up when doing iOS development - the version of xcode you have isn't compatible with the version of iOS on your device, you can't back out the version of iOS on your device without using a third party tool, your Mac can't update to the version of xcode you need to deploy to the device you're using, you need to reconnect the usb cable to your device, you need to restart your iOS device to be able to communicate with your Mac, etc etc etc.

No idea how anyone create's iOS applications without tearing out all of their hair.