Skip to content

Renew Apple Certificate Procedure

Harel M edited this page Jun 13, 2024 · 8 revisions

Once a year there's a need to update the apple certificate due to expiration. The following are the steps that needs to be done:

  1. Go to key-chain app and delete the expired certificate and private key (they should have the same name: Harel Mazor, Harel Mazor (2K...)
  2. In XCode, open Settings..., select Accounts, select the IHM account, click Manage Certificates..., click the "+" at the bottom and click
    Apple Distribution. This will create a new non-expired certificate
  3. Go to https://developer.apple.com/account/resources/certificates/list and make sure there's a new certificate that is not expired
  4. Go to the profiles and edit the CI provisioning profiles to use the new certificate
  5. Download the provisioning profile
  6. Go to key-chain app and export the distribution certificate by right click and Export ..., choose cer file extension
  7. Export the private key using right click end Export... when asked, put the store password
  8. Encrypt all files with (p12, cer, provisioning profile) with: /opt/homebrew/opt/[email protected]/bin/openssl aes-256-cbc -pbkdf2 -k the-password -in ~/Downloads/file -e -a -out ./file.enc
  9. cat ./CI.mobileprovision | grep UUID -a -A 1 to get the UUID
  10. Update IsraelHiking.Web/ios/App/App.xcodeproj/project.pbxproj PROVISIONING_PROFILE field
  11. Update IsraelHiking.Web/ios/exportOptions.plist provisioningProfiles field
  12. Commit and push them to GitHub
  13. Make sure the build runs as expected and the ipa file gets archived and uploaded to the app store