My iOS application cannot connect to the Sandbox environment.

I am testing the subscription flow in my iOS app. Initially, everything was working fine when following the official StoreKit and sandbox testing documentation. After a successful subscription, the “You’re all set” popup always displayed the environment as “sandbox.” However, after some changes, possibly upgrading macOS to the latest version, upgrading Xcode, or regenerating certificates, I can no longer connect to the sandbox testing environment. The subscription success popup now always shows the environment as “xcode.”

By default, the iOS app should run in the sandbox on macOS, so I didn’t set the “Enable App Sandbox” option to “Yes” in the Xcode build settings. When I try enabling it, Xcode throws the following error:

“Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.n3J0tr/extracted/Payload/XXXX.app : 0xe8008015 (A valid provisioning profile for this executable was not found.) Please ensure that your app is signed by a valid provisioning profile.”

Additionally, if “Enable App Sandbox” is set to “No,” the app installs successfully on a real device, but there is no prompt to trust an untrusted developer certificate, which usually appears for such certificates.

I’m not sure if this information will be useful to others, but I’ve been stuck on this issue for a while, and it’s preventing me from moving forward with my work. Any help to resolve this would be greatly appreciated. Thank you!

The subscription success popup now always shows the environment as “xcode.

When you enable StoreKit Testing in Xcode, all your purchases occur in the local environment.

When you disable StoreKit Testing in Xcode , purchases occur in the sandbox environment. To test in the sandbox, remove the StoreKit configuration file from your scheme's run options.

I have been troubleshooting the issue of app signing and sandbox configurations for in-app purchase testing, and I believe the problem may be related to the developer certificate. As you mentioned, I have enabled sandbox support and the App Sandbox and In-App Purchase capabilities in Signing & Capabilities. However, I am encountering two problems that I believe are caused by the developer certificate: 1. When “Enable App Sandbox” is set to “No” in Build Settings, the app can be installed on the physical device. However, there is no prompt to trust an untrusted developer, and there are no certificates listed in the VPN or Device Management on the device. Moreover, the subscription test shows that the environment is set to “Local Xcode,” and transaction-related IDs are all 0. It seems the app is running in the local environment instead of the sandbox environment, and the installed app on the device is not signed with a developer certificate. 2. When “Enable App Sandbox” is set to “Yes” in Build Settings, Xcode throws the following error: Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.Eq1o6c/extracted/Payload/XAPP.app : 0xe8008015 (A valid provisioning profile for this executable was not found.) Please ensure that your app is signed by a valid provisioning profile. If this issue persists, please attach the following when sending a report to Apple:

  • A sysdiagnose from this Mac
  • A sysdiagnose from the device failing installation
  • An IPA of the app failing installation.

I have searched extensively on the Apple Developer Forums and other resources, and it seems this issue is related to the certificates. I have attempted to switch to manual signing, regenerate my developer certificates (both through Xcode and App Store Connect), but none of these attempts have resolved the issue. This problem has been ongoing for two weeks, and I am urgently seeking assistance in resolving it.

Thank you for your support!

Please perform these steps:

  1. Set Enable App Sandbox to No.

  2. Navigate to the Run action of your scheme the select the Options tab.

  3. Select None from the StoreKit Configuration.

  4. Your Xcode project uses automatic signing. Configure Xcode to request new provisioning profiles by deleting your existing profiles at ~/Library/MobileDevice/Provisioning Profiles/ .

  5. Build and run your project again.

the latest version, upgrading Xcode, or regenerating certificates, I can no longer connect to the sandbox testing environment. The subscription success popup now always shows the environment as “xcode.”

Can you post a screenshot of the above issue and a screenshot of the Supported Destinations in the General pane of the target building your app.?

My iOS application cannot connect to the Sandbox environment.
 
 
Q