Why is my APP_STORE_CONNECT_PRIVATE_KEY environment variable not updating between builds?
Last updated: July 27, 2026
Context
You have updated the APP_STORE_CONNECT_PRIVATE_KEY environment variable in your app-level variable group, but builds continue to use the old value regardless of what you save. This can happen even after waiting for propagation and re-triggering multiple builds.
Answer
APP_STORE_CONNECT_PRIVATE_KEY (along with APP_STORE_CONNECT_ISSUER_ID and APP_STORE_CONNECT_KEY_IDENTIFIER) are reserved variable names in Codemagic. If your codemagic.yaml workflow contains an integrations: app_store_connect: block, Codemagic automatically injects these variables from the App Store Connect code signing identity configured in the UI — independently of any environment variable groups you have set up.
Because the automatically injected value takes precedence, any changes you make to a variable with the same name in your variable group will have no effect.
To resolve this, do one of the following:
If you are not using the
integrations: app_store_connect:block for code signing, remove it from yourcodemagic.yaml. Codemagic will then use the value from your environment variable group as expected.If you need to keep the integration block, rename your environment variable to something other than
APP_STORE_CONNECT_PRIVATE_KEYto avoid the conflict, and update any references to it in your workflow scripts accordingly.
For more details on how Codemagic injects App Store Connect variables, refer to the alternative code signing methods documentation.
Note: there is no cache to clear for environment variables — they are read fresh at the start of each build.