How to modify default APS Environment? (aps-environment)

It looks like APS Environment is configured by setting the aps-environment value in an app entitlements file to either development or production. However, it seems to be the case that, by default, Xcode automatically overrides the set value when an app is signed and the value is instead derived from the provisioning profile.

So, for development profiles, you get development (sandbox) aps-environment, and for distribution profiles, you get production aps-environment configured - regardless of how the setting has been configured in the entitlements plist.

This is documented here: https://developer.apple.com/documentation/bundleresources/entitlements/aps-environment

That document also states that this default behaviour can be overridden: "These default settings can be modified".

Question is, how to override these default settings. In other words, how to point aps-environment to production, even if provisioning profile is development.

Any insight appreciated, thx.

@secretchimp - did you ever find an answer to this question? I'm in a situation where I'd like to specify sandbox for an ad-hoc build that points at a test environment.

Hi @CloudosaurusRex , I did not get an answer - we have just accepted that this is how it works. Many attempts to workaround, but basically, when the app is signed with the certificate and profiles to produce an IPA, it is at that stage the aps-environment is set.

Sign with a distribution certificate (adhoc/store/inhouse) - you get prod - sign with a developer certificate, you get sandbox

How to modify default APS Environment? (aps-environment)
 
 
Q