---
id: "sdk-guides/capacitor-cocoapods-to-spm-migration"
title: "Migrate the Capacitor SDK from CocoaPods to Swift Package Manager"
description: "Move an existing Capacitor iOS project and its RevenueCat plugins from CocoaPods to Swift Package Manager (SPM)."
permalink: "/docs/sdk-guides/capacitor-cocoapods-to-spm-migration"
slug: "capacitor-cocoapods-to-spm-migration"
version: "current"
original_source: "docs/sdk-guides/capacitor-cocoapods-to-spm-migration.mdx"
---

> **AI agents:** This is the Markdown version of a RevenueCat documentation page. For the complete documentation index, see [llms.txt](https://www.revenuecat.com/docs/llms.txt).

Move an existing Capacitor iOS project and its RevenueCat plugins from CocoaPods to Swift Package Manager (SPM).

:::warning CocoaPods releases end on December 2, 2026

[CocoaPods trunk becomes read-only](https://blog.cocoapods.org/CocoaPods-Specs-Repo/) 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:

```shell
npm install
```

If this moves you to a new major version, follow its [migration guide](https://github.com/RevenueCat/purchases-capacitor/tree/main/migrations).

## 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:

```shell
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:

```shell
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](https://www.revenuecat.com/docs/getting-started/installation/ios#3-enable-the-in-app-purchase-capability), then continue with step 5.

## 4. Finish the Xcode setup

1. Run `npx cap open ios`.
2. Select the **App** project, open **Package Dependencies**, and click **+ > Add Local…**.
3. Select `ios/App/CapApp-SPM`, click **Add Package**, and add its product to the **App** target.
4. In the project's **Info** tab, under **Configurations**, set `ios/debug.xcconfig` as the **Debug** configuration file. Adding the file to the project alone isn't enough. If Debug already uses a custom `.xcconfig`, keep it and `#include` the generated file from it instead.
5. Remove `#include` lines referencing `Pods-*.xcconfig` from any custom Debug or Release `.xcconfig` files. Preserve their other settings.

See [Capacitor's screenshots](https://capacitorjs.com/docs/ios/spm#using-our-migration-tool) 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:

```shell
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.

1. Confirm that `ios/App/CapApp-SPM/Package.swift` lists `RevenuecatPurchasesCapacitor`, and `RevenuecatPurchasesCapacitorUi` if used. The CLI manages this file; don't edit it.
2. Build Debug and your release archive from `App.xcodeproj`.
3. 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.
4. Commit the changes and lockfiles. In any build scripts, replace references to the deleted `App.xcworkspace` with `App.xcodeproj` and remove `pod install` steps.

## 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](https://www.revenuecat.com/docs/getting-started/installation/capacitor) or [Capacitor's SPM guide](https://capacitorjs.com/docs/ios/spm).
