34

My iOS certificate is stored in GitHub and it is expired, the failure message in circleci progress is that ‘Your certificate 'xxxxxxx.cer' is not valid, please check end date and renew it if necessary’.

Do I need to create a new certificate, or download an existing one? I don’t remember how this was originally created, I thought it was done by Fastlane as part of the build.

But I don't know how to modify the Fastlane command, I have tried to add the 'cert', but it fails.

CleanMac
  • 473
  • 1
  • 4
  • 6

4 Answers4

47

You can use fastlane match development after deleting the development profiles and certificates from your git repo. Alternatively, you can delete everything from git repo and run fastlane match

If you do not care about existing profiles and certificates, just run fastlane match nuke development and fastlane match nuke appstore, then fastlane match development and fastlane match appstore. These commands will first delete everything from your git repo and apple developer portal and the next two commands will create everything on your apple developer portal and push them to your git repo.

Read up this

kerry
  • 2,362
  • 20
  • 33
  • 5
    I just can't believe why match can't have an argument so it by default does exactly that for the specified profiles and certificates - it is a terrible manual process every time! – Morten Holmgaard Mar 02 '21 at 20:15
18

Before start ensure you got certificates repo in github

https://docs.fastlane.tools/actions/match/

Clearing old certificates

fastlane match nuke development
fastlane match nuke distribution

After clearing, we need to re-create new certificates

fastlane match development
fastlane match appstore

and restart your Xcode

Giang
  • 2,384
  • 2
  • 25
  • 26
  • It is important to add that you have to **make sure to use the latest version of Fastlane or, the same version used by your CI/CD tool**, otherwise CI/CD may fail even after following the steps above. – Pedro Massango Nov 22 '22 at 10:19
8

I renewed expired certificate by deleting it from the Git repository and then running fastlane match. If you append --force it will also renew the profiles to use the new certificate.

Steps:

  1. Delete expired certificate from Git repository.
  2. Run fastlane match development --force to renew certificate and profiles. (Replace development with appstore or adhoc depending on your certificate type.
Fogh
  • 1,275
  • 1
  • 21
  • 29
1

I find the simplest way is to delete the expire .cer on Develop portal and run match again.

蘇健豪
  • 541
  • 4
  • 13