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,

Accepted Reply

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"

  • Thank you very much for this clear explanation !

Add a Comment

Replies

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"

  • Hi, Yes I am targeting iOS. Usually I use fastlane to create my IPA. But I got the same behaviour with organiser :

    if I use a development provisioning profile in organiser, the .ipa generated by xcode will have aps-environement set to "development"if I use distribution provisioning profile (ad-hoc or in house) in organiser, the .ipa generated by xcode will have aps-environement set to "production". 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)
Add a Comment

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"

  • Thank you very much for this clear explanation !

Add a Comment