Migrate the Capacitor SDK from CocoaPods to Swift Package Manager
Move the RevenueCat Capacitor SDK's iOS dependencies from CocoaPods to Swift Package Manager
Move an existing Capacitor iOS project and its RevenueCat plugins from CocoaPods to Swift Package Manager (SPM).
CocoaPods trunk becomes read-only on December 2, 2026. Existing versions remain available; migrate to Swift Package Manager to keep receiving RevenueCat's native SDK updates.
Prerequisites
- Capacitor 8, or Capacitor 7 with Capacitor CLI 7.4.4 or later within 7.x.
- A working app committed to version control.
- CocoaPods still installed: the migration tool needs it to remove the existing integration.
1. Update the RevenueCat packages
In package.json, use an SPM-compatible version of @revenuecat/purchases-capacitor:
| Capacitor | RevenueCat SDK |
|---|---|
| 8 | 12.0.3 or later |
| 7 | 11.3.3 or later within 11.x |
If using @revenuecat/purchases-capacitor-ui, update its constraint to the same SDK version. Keep a newer compatible version if already installed. Then run:
npm install
If this moves you to a new major version, follow its migration guide.
2. Check all native dependencies
Every Capacitor plugin must support SPM. Check its documentation and update or replace incompatible plugins before continuing. Cordova plugins usually work, but the tool generates a Package.swift for each one, so test them after migrating.
Also inspect your Podfile for manually added pods and hooks, and migrate them first: the tool deletes the Podfile, and its plugin checks don't cover custom native integrations.
3. Run the migration tool
From the app root:
npx cap spm-migration-assistant
The tool runs pod deintegrate, deletes the Podfile, Podfile.lock, and App.xcworkspace, and creates ios/App/CapApp-SPM and ios/debug.xcconfig. If it warns that a plugin is incompatible or CocoaPods deintegration was skipped, stop. Restore your native project from version control, resolve the warning, and rerun the migration.
Alternative for an unmodified native project
If your Xcode project has no customizations to preserve, delete ios/, then run:
npm run build
npx cap add ios --packagemanager SPM
Use your app's equivalent web-build command if different. This recreates the native project. Reapply required settings, including the In-App Purchase capability, then continue with step 5.
4. Finish the Xcode setup
- Run
npx cap open ios. - Select the App project, open Package Dependencies, and click + > Add Local….
- Select
ios/App/CapApp-SPM, click Add Package, and add its product to the App target. - In the project's Info tab, under Configurations, set
ios/debug.xcconfigas the Debug configuration file. Adding the file to the project alone isn't enough. If Debug already uses a custom.xcconfig, keep it and#includethe generated file from it instead. - Remove
#includelines referencingPods-*.xcconfigfrom any custom Debug or Release.xcconfigfiles. Preserve their other settings.
See Capacitor's screenshots for the package and configuration dialogs.
5. Build and verify
Build your web assets before syncing them to the native project. From the app root, run:
npm run build
npx cap sync ios
Use your app's equivalent web-build command if different. If npx cap sync warns about incompatible plugins, resolve them before continuing.
- Confirm that
ios/App/CapApp-SPM/Package.swiftlistsRevenuecatPurchasesCapacitor, andRevenuecatPurchasesCapacitorUiif used. The CLI manages this file; don't edit it. - Build Debug and your release archive from
App.xcodeproj. - Run your existing purchase flow in your test environment. If you use RevenueCatUI, also open any paywall or Customer Center your app uses. This catches resource issues that a successful build can miss.
- Commit the changes and lockfiles. In any build scripts, replace references to the deleted
App.xcworkspacewithApp.xcodeprojand removepod installsteps.
Troubleshooting
If Xcode fails to resolve packages after adding or updating plugins, choose File > Packages > Reset Package Caches, then build again.
Next steps
See the Capacitor install guide or Capacitor's SPM guide.