Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kim3er/628fcab97e7cff0cd36a65402a2f2e59 to your computer and use it in GitHub Desktop.
Save kim3er/628fcab97e7cff0cd36a65402a2f2e59 to your computer and use it in GitHub Desktop.
Making Apple Developer certificates on WSL (Linux) for Azure Pipelines

This document describes how to create an Apple certificate and provisioning profile for use in Azure Pipelines, using WSL. The document assumes the follwing stack:

  1. Windows with WSL, but should be the same with straight Linux.
  2. Open SSL installed.
  3. You're using Azure Pipelines to delpoy.
  4. You're building a Cordova project.

Tips:

  1. I typically start from the home directory (~).
  2. WSL can be accessed from the star menu, wsl.
  3. You can access WSL files from Explorer, look for the Linux logo.
  4. If you're asked to create a password, create one. Pipelines will fail without one.

Steps:

  1. Create a new directory;
mkdir ios
cd ios
  1. Generate a certificate signing request
openssl req -nodes -newkey rsa:2048 -keyout ios.key -out ios.csr
  1. With the information like so (ensure you give it a password):
Country Name (2 letter code) [AU]: GB
State or Province Name (full name) [Some-State]: London
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]: Total Onion Ltd
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []: Total Onion Enterprise
Email Address []:
  1. Login to developer.apple.com, go to:

"Member Center" -> "Manage your certificates, App IDs, devices, and provisioning profiles." -> "Certificates" -> "Add"

  1. Go through the wizard, selecting the certificate type, and uploading the .csr.

  2. Download the .cer file, saving it to the folder created in step 1

  3. Convert the .cer file to a .pem file:

openssl x509 -in ios.cer -inform DER -out ios.pem -outform PEM
  1. Convert the .pem to a .p12:
openssl pkcs12 -export -inkey ios.key -in ios.pem -out ios.p12
  1. You can now create a "Provisioning Profile" in the "Member Center" on developer.apple.com using the certificate you made in step 4

  2. Upload the new certificate and provisioning profile as secure files, to Library in DevOps. If you keep the ame names as before, you will not need to edit the pipeline file. For reference the relevant parts off the pipeline file are here:

  - task: InstallAppleCertificate@2
    displayName: "Install Apple certificate"
    inputs:
      certSecureFile: "ios.p12" <-- Certificate file
      certPwd: "$(P12Password)" <-- Password you created

  - task: InstallAppleProvisioningProfile@1
    displayName: "Install provisioning profile"
    inputs:
      provProfileSecureFile: "ios.mobileprovision" <-- Provisioning file
  1. In the root of the project, you need to update build.json with the Provisioning Profile UUID. You get this by opening up the provisioning profile in a text editor, look for 'Key>UUID'. The identifier you're looking for is the following UUID.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment