StoreKit Configuration: how to reset testing state?

I've been testing in app purchase using a StoreKit Configuration file in Xcode 13. This is a great feature, and makes things much easier.

However, I can't figure out how to reset the state back to initial conditions (i.e. no purchases).

On iOS simulators, I have found that the menu command Device->Erase All Content And Settings works. While it's cumbersome, it does the trick.

However, I'm testing a Mac catalyst version of my app, and have found several issues with StoreKit testing here.

On macOS Big Sur, the reliability of getting a receipt written to my app is very low. Either no _MASReceipt/receipt gets written, or it will get written to for one debugging session, and then stop updating. The only way I have found to get the receipt to update again is to reboot my system.

The other, arguably worse problem with Mac catalyst and StoreKit testing, is that I really do need to reset the state to initial conditions. In the course of my app running in the debugger with a very high renewal rate, my receipt has amassed 23,000+ transactions in it. There is no "Reset Contents and Settings" here like in the iOS simulator obviously. And the Xcode transactions editor window comes up empty, so I can't delete them there.

I'm sure there's some file/directory somewhere that I can delete, I just have no idea what it is or where to look.

Any tips would be appreciated!

I was able to track down the files in question, in case anyone else in the future needs to know.

For StoreKit testing on Mac catalyst, check the directory:

~/Library/Caches/com.apple.appstoreagent/Octane

The sqlite file store.db contains a table octane_transaction with the transactions in question, and I was able to delete my 23,000 test transactions from it.

@jrg405, you can delete previous transactions from within Xcode. When the app is running you can tap on the "Manage StoreKit Transactions" button that is the last of several buttons that control the debugger. [Find the button you tap to pause the debugger and then look several icons to the right of that.]

This brings up a window with all the transactions that have been created. You can select a transaction and carry out various options like cancelling it. You can also delete one or more transactions. If you delete them all then you get reset to the original state, which is what I think you are wanting to do.

Of course you can delete transactions with the UI, perhaps many at a time, but I had 23,000 transactions to remove and the UI couldn't handle deleting them in that kind of bulk. It would lock up/crash. The only way to restore it to its virgin state was to just trash the store.db file.

StoreKit Configuration: how to reset testing state?
 
 
Q