Skip to main content
Question

How to remove entry from keychain when testing

  • June 23, 2026
  • 1 reply
  • 6 views

Forum|alt.badge.img

Trying to test purchase flows using my iPhone and test flight and I can’t seem to get rid of the item burned into the keychain that makes the purchase stick. I need a way to clear everything and start over.

Please advise.

1 reply

Tarek
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • June 24, 2026

Hi Matthew,

I'm Tarek from RevenueCat Developer Support, thanks for reaching out, happy to help here.

I took a look, and the keychain isn't actually what's holding onto the purchase. Our iOS SDK doesn't store anything in the keychain, it just caches a bit of data in UserDefaults, which is wiped the moment you delete the app.

 

What's really "sticking" is on Apple's side: in sandbox and TestFlight the purchase is owned by the Apple Account you bought with, and it lives in the app receipt on the device. So reinstalling the app, or even deleting the customer in RevenueCat, won't clear it, the next restore or purchase just re-links it. And if it's a subscription, it's also auto-renewing on its own (in TestFlight, once every 24 hours), so it looks permanently active.

 

To get a clean slate, here are your options depending on how you want to test:

  • For fast, repeatable testing, I'd recommend a local StoreKit Configuration file in Xcode instead of TestFlight. It lets you delete every transaction instantly from Xcode's StoreKit Transaction Manager (Debug menu while the app is running), so you can reset whenever you want. RevenueCat setup: https://www.revenuecat.com/docs/test-and-launch/sandbox/apple-app-store and Apple's guide: https://developer.apple.com/documentation/xcode/setting-up-storekit-testing-in-xcode
  • For on-device sandbox testing (a build run from Xcode, not TestFlight), create a new Sandbox Apple Account in App Store Connect, then sign the old one out on the device under Settings > Developer > Sandbox Apple Account (or Settings > App Store > Sandbox Account on older iOS). A fresh sandbox account gives you a clean purchase history. Steps: https://www.revenuecat.com/docs/test-and-launch/sandbox/apple-app-store#create-a-sandbox-test-account
  • In TestFlight specifically this is trickier, because TestFlight uses your real Apple Account in the sandbox environment rather than a switchable sandbox tester. If it's a subscription, you can cancel it from Settings > [your name] > Subscriptions and let it lapse, or just wait for it to stop renewing. Otherwise, the cleanest path is one of the two approaches above. I'd suggest keeping TestFlight for a final end-to-end check rather than day-to-day iteration.

 

Let me know if that makes sense and if there's anything else I can help with!

Best regards,