Force APNS environement to ‘development’ even for distribution builds

Hello,

My aps-environment entitlement is set to development in my app.entitlements file.

However when I build my application as an archive (to generate an .ipa file), the aps-environment entitlement is automatically modified to production by Xcode because it uses a Distribution provisioning profile. I read in APS Environment Entitlement documentation that this default behaviour can be changed :

But I didn't find a way to do it. Is it possible to change (force) this aps-environment to development even for a distribution build ?

Indeed I don't want it to be production as the .ipa is for test purpose only (it is not the Store build).

Thank you very much for your help,

Answered by DTS Engineer in 709500022

And I don't want it because I will provide this ipa to my test team (and I would like to be on the sandbox APNS environment)

This isn’t going to work. A provisioning profile ties together a bunch of things, including a set of signing certificate, the supported devices, and an entitlement allowlist. For more details on that, see my What exactly is a provisioning profile? post.

If you create a distribution profile, in order to get the distribution list of supported devices, it always includes a distribution allowlist. Most entitlements don’t vary based on this, but for aps-environment a distribution allowlist always contains production.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

So, just to confirm:

  • You’re targeting iOS.

  • You’re using the Xcode organiser to create your .ipa.

Right?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

And I don't want it because I will provide this ipa to my test team (and I would like to be on the sandbox APNS environment)

This isn’t going to work. A provisioning profile ties together a bunch of things, including a set of signing certificate, the supported devices, and an entitlement allowlist. For more details on that, see my What exactly is a provisioning profile? post.

If you create a distribution profile, in order to get the distribution list of supported devices, it always includes a distribution allowlist. Most entitlements don’t vary based on this, but for aps-environment a distribution allowlist always contains production.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Force APNS environement to ‘development’ even for distribution builds
 
 
Q