StoreKit testing in Xcode for an existing macOS app

Hello,

I'm trying to enable StoreKit testing in Xcode for an existing macOS app.

I'm using Xcode 12 on macOS Big Sur Beta, I've added a StoreKit configuration file to my project and selected it in the scheme configuration. However my app is still connecting to the App Store sandbox environment when testing.

I've tried the Fruta sample code project available here: https://developer.apple.com/documentation/swiftui/fruta_building_a_feature-rich_app_with_swiftui
When testing the macOS app of this project, it is properly connecting to the Xcode StoreKit testing environment.

I've compare the configuration of the two projets (build settings, schemes, entitlements, ...) and I see nothing that could explain why they behave differently.

Am I missing something here?
It sounds like you've performed the right steps:
  1. Create the .storekit file

  2. Add the product metadata to the file

  3. Select the .storekit configuration file in your scheme's run options

  4. Run the app

If you're not seeing it at this point, would you be able to collect a sysdiagnose and then submit feedback with that sysdiagnose attached? If you reply with the feedback ID we can take a look at it.

I think I found the origin of the problem.

I looked in the Console to see if there were any error log emitted by my app or the App Store and I found this:
  • appstoreagent Entering -[OctaneService saveConfigurationData:forBundleID:completion:] for com.company.App by DTServiceHub

  • error appstoreagent Ignoring method call from com.company.App because the app (DTServiceHub) is not valid for Octane

  • error DTServiceHub [DTStoreKitService] Failed to save configuration file for com.company.App: Error Domain=ASDErrorDomain Code=950 "The requested action is invalid for this application" UserInfo={NSDebugDescription=The requested action is invalid for this application}

It appears that Octane is the code name of the component handling StoreKit testing in Xcode :)

The message seems to indicate that the app associated with the bundle ID does not support StoreKit testing. Since my app is already existing on the App Store and I have a release version installed in the Applications folder, I thought that Octane may be looking for the app to test by its bundle ID and not by its path.

So I tried to delete the release version of the app from the Applications folder and it did the trick!

May be a warning could be added to StoreKit testing documentation about this.
Also I'm a bit afraid of what will happen when there will be archived versions of the app in the DerivedData folder, could it also conflict with the app being tested?
StoreKit testing in Xcode for an existing macOS app
 
 
Q