I'm trying to test my StoreKit package using local "Consumable.storekit" configuration added to test target as a .copy() resource.
I receive various errors. On purchase attempts I receive StoreKitError.unknown. In the console I see this diagnostic messages:
[SKTestSession] Error saving configuration file: Error Domain=SKInternalErrorDomain Code=3 "(null)"
[SKTestSession] Error setting value to 1 for identifier 2 for com.apple.dt.xctest.tool: Error Domain=SKInternalErrorDomain Code=3 "(null)"
I these last two cases product loading failed.
It feels like session require mutable .storekit file? Also, some people mention that Host Application must be selected, but it's related to Xcode projects. What is the correct way to test StoreKit within a Swift Package?
I figured out this problem.
- Mutable file (copying .storekit to temp dir) dind't help.
- Xcode project helps! SKTestSession works within a host application. Testing within Swift Package is impossible.
- Also important: on iOS 26.5 simulator tests would fail, as discussed here. However they work on iOS 26.5 device, or iOS 26.0-26.2 simulators.