Search code examples
iosfastlanefastlane-match

Fastlane match with 2 developer accounts


Our app has multiple configurations and uses an enterprise developer account for some use cases and an appstore account for other use cases. I'm able to use match with both accounts by managing environment files, but run into a blocker when it comes to creating the developer certificate for the appstore account - it's attempting to use the Enterprise Account's certificate which obviously isn't available in the appstore account's portal.

I ran fastlane match development --env enterprise_all to match our enterprise bundleIds and generate a development provisioning profile for our enterprise account for each configuration and match that to a signing certificate.

I also ran fastlane match enterprise --env enterprise_all to do the same for the enterprise (In-House) certificate

I then ran fastlane match appstore --env appstore_all to get distribution assets for our appstore account

But when I run fastlane match development --env appstore_all to get dev assets for our appstore account, it's using the development certificate created for the enterprise account.

Certificate 'VALUE' (stored in your storage) is not available on the Developer Portal [16:17:09]: for the user USER

How can I generate development certificates using fastlane for 2 different accounts using the same app?


Solution

  • I was able to resolve this by using a different branch for the appstore environment. Using this method after having already synced enterprise signing certificates (including development certificates), match will only use appstore signing resources for environments using the appstore branch and enterprise resources otherwise.

    .env.appstore_all:

    MATCH_GIT_BRANCH=appstore
    

    fastlane match appstore --env appstore_all

    fastlane match development --env appstore_all