Our iPhone builds run in the cloud, because we develop on Windows. The first working pipeline signed the app automatically and it worked, until it did not. Every run quietly created one more certificate in the developer account, and one day the builds started failing with a missing private key. This is what was happening and the setup that replaced it.
The symptom: certificates piling up
With cloud-managed signing during the archive step, the build asks the App Store Connect API for what it needs. In our case that meant a new Apple Development certificate with the note Created via API on every single build. They add up fast. The account has a limit on how many certificates of a type it can hold, which we hit at around eleven.
Then the second failure appeared: the archive step complained that the private key was not installed.…