Skip to main content

Generating iOS code signing files

You'll need two kinds of files to sign your app: certificates and provisioning profiles.

The certificates - development or distribution - are the guarantee that you, the named developer, built this code, that you are a member of the developer program, and that Apple have issued you with a certificate to do so.

To get a certificate, you need to generate a Certificate Signing Request with Keychain Access and send it to Apple. This will create a public/private key pair for you if you don't have one already. Apple will then verify the information, and create a certificate for you.

Provisioning is the process of preparing and configuring an app to launch on devices and to use app services. Development provisioning profiles holds the device identifiers (UUID) that is eligible to run your app. Distribution provisioning profiles can include App Store profiles that allow you to distribute your app to the App Store. Ad-hoc profiles are good for distributing to your testers.

Generating a code signing certificate with XcodeClick to copy link

First, add your Apple Account to Xcode. If you've already done this, skip ahead to creating the certificate.

  1. Start Xcode.
  2. Choose Xcode > Settings.
  3. In the toolbar, click Accounts.
  4. Click the + button in the lower-left corner and select Add Apple ID….
  5. In the dialog that appears, enter your Apple Account credentials and select Sign in. If you don't have an account yet, select Create Apple ID.
  6. Select your Apple Account and team from the list, then click Manage Certificates.
  7. In the signing certificates sheet, click the + button in the lower-left corner and choose a certificate type, such as Apple Development or Apple Distribution, from the pop-up menu. Xcode generates and installs the certificate for you.
  8. Click Done.
Removing a certificate

To remove a certificate, Control-click it in the signing certificates sheet and select Delete Certificate. You can only delete certificates that you or a team member has revoked in your developer account.

Generating a code signing certificate manuallyClick to copy link

  1. Open your Keychain Access app on macOS.
  2. Select Keychain Access > Certificate Assistant > Request a Certificate From a Certificate Authority….
  3. Fill in your User Email Address and Common Name, and select Saved to disk.
  4. Click Continue and save the generated .certSigningRequest file locally.
  5. Go to developer.apple.com and log in to your account.
  6. Select Certificates, Identifiers & Profiles from the left sidebar.
  7. Go to Certificates and click the + button in the top-right corner.
  8. Select a certificate type, such as Apple Development for development or Apple Distribution for distribution, and click Continue.
  9. Upload the .certSigningRequest file you created and click Continue. Apple generates your code signing certificate.
  10. Download the certificate and double-click it to install it in Keychain Access.

Generating a provisioning profile with XcodeClick to copy link

Xcode automatically generates an App ID for your project that matches your project's unique bundle ID. An App ID identifies one or more of your apps: it can be an explicit App ID that matches only one bundle identifier, or a wildcard App ID that matches multiple ones.

With automatic signing enabled, Xcode also creates and manages a provisioning profile for your project automatically (sometimes called an Xcode Managed Profile), so you can start deploying to your device without any manual steps.

If you hit any issues, make sure the device is eligible (for example, you'll get an error if the device doesn't match the deployment target) and that your app is connected to the correct team.

To generate a provisioning profile using Xcode:

  1. Select your project file from Xcode's project navigator.
  2. Go to the Signing & Capabilities tab and select your correct team from the Team menu.
  3. Build your project in Xcode.

To download a provisioning profile from Xcode:

  1. Start Xcode.
  2. Choose Xcode > Settings.
  3. In the toolbar, click Accounts.
  4. Select your Apple Account and team, then click Download Manual Profiles.
  5. Your profiles are downloaded to ~/Library/MobileDevice/Provisioning Profiles/.

Generating a provisioning profile manuallyClick to copy link

To generate a provisioning profile manually, you need a working Apple Developer account, and you need to set up an App ID for your project.

Setting up an App IDClick to copy link

  1. If you haven't already created an App ID for your project, go to developer.apple.com and log in.
  2. Select Certificates, Identifiers & Profiles from the left sidebar.
  3. Navigate to Identifiers > App IDs.
  4. In the App ID Description, add a recognizable name for your App ID.
  5. Select Explicit App ID and add your bundle identifier to the field.
  6. Select any additional App Services that you need.
  7. Click Continue.

Generating a provisioning profileClick to copy link

  1. Go to developer.apple.com and log in.
  2. Select Certificates, Identifiers & Profiles from the left sidebar.
  3. Navigate to Profiles.
  4. Select the + from the top-right corner.
  5. For development, select the correct project type under Development, or for distribution, select the correct one under Distribution, and click Continue.
  6. Select the App ID you would like to use, and click Continue.
  7. Select the certificates you wish to include in the provisioning profile. These certificates will be able to build with this profile. Click Continue.
  8. Select all the devices you would like to use with this profile and click Continue.
  9. Name your provisioning profile and click Generate.
  10. Your profile is generated. Download it and double-click it to install it on your Mac.