---
id: "sdk-guides/ios-native-cocoapods-to-spm-migration"
title: "Migrate the iOS SDK from CocoaPods to Swift Package Manager"
description: "Move the RevenueCat iOS SDK from CocoaPods to Swift Package Manager (SPM), keeping your current SDK version during the migration."
permalink: "/docs/sdk-guides/ios-native-cocoapods-to-spm-migration"
slug: "ios-native-cocoapods-to-spm-migration"
version: "current"
original_source: "docs/sdk-guides/ios-native-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 the RevenueCat iOS SDK from CocoaPods to Swift Package Manager (SPM), keeping your current SDK version during the migration.

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

:::

This guide is for native Apple-platform apps. For Flutter, React Native, or another cross-platform SDK, use its [migration guide](https://www.revenuecat.com/docs/sdk-guides/spm-migration-guides-index).

## 1. Note your current SDK version

Find `RevenueCat` in `Podfile.lock`, for example `RevenueCat (5.98.0)`. Use that **exact version** in step 3 to keep the dependency-manager migration separate from an SDK upgrade.

## 2. Remove the RevenueCat pods

Commit your project first, so you can review or undo the changes. Run pod commands from the directory containing your Podfile. If you use Bundler, use `bundle exec pod deintegrate` or `bundle exec pod install` for the commands below.

### If RevenueCat is your only CocoaPods dependency

1. Run `pod deintegrate`.
2. Delete `Podfile`, `Podfile.lock`, and `Pods/`.
3. Delete the app-level `.xcworkspace` only if CocoaPods was its sole purpose. Keep custom workspaces.
4. Open the `.xcodeproj`, or your custom workspace. Update any build scripts that reference the deleted workspace, and remove their pod-install step.

### If your app still needs other pods

1. Remove the `pod 'RevenueCat'` and `pod 'RevenueCatUI'` declarations from every target in your Podfile.
2. Run `pod install`.
3. Keep opening the `.xcworkspace`. Check that the remaining pods don't pull in another copy of RevenueCat.

## 3. Add the RevenueCat Swift package

1. In Xcode, select **File > Add Package Dependencies** and enter:

```text
https://github.com/RevenueCat/purchases-ios-spm.git
```

2. Select **Exact Version** and enter the version from step 1.

3. Click **Add Package**. Add **RevenueCat** to your app target, and **RevenueCatUI** if you used its pod. Leave the other products set to **None**. Don't link **RevenueCat_CustomEntitlementComputation** alongside **RevenueCat**.

   ![Package products with RevenueCat and RevenueCatUI selected](https://www.revenuecat.com/docs_images/sdk/spm-integration.png)

4. Click **Add Package** again.

For each additional target that used RevenueCat, such as an extension, open **General > Frameworks, Libraries, and Embedded Content**, click **+**, and add the same package product.

Use `purchases-ios-spm.git` consistently. If another dependency already uses `purchases-ios.git`, align its package URL first: referencing both repositories causes duplicate-target errors. The [RevenueCat AdMob adapter](https://www.revenuecat.com/docs/getting-started/adapter-sdks/admob) uses `purchases-ios-spm.git`.

## 4. Check imports

Swift imports remain `import RevenueCat` and `import RevenueCatUI`.

For Objective-C files importing RevenueCat headers, use the module import:

```objectivec
@import RevenueCat;
```

## 5. Build and verify

1. Select **Product > Clean Build Folder**, then build Debug and your release archive.
2. Run your existing purchase flow in your test environment. Open any paywall or Customer Center your app uses.
3. Commit the project changes and Xcode's `Package.resolved`.

To upgrade the SDK later, change its version requirement under **Package Dependencies**, then resolve packages again.

## Troubleshooting

### Package resolution reports a conflicting target name

An error saying that multiple packages declare targets with a conflicting name means your project references both `purchases-ios.git` and `purchases-ios-spm.git`. Switch every reference to `purchases-ios-spm.git`.

### Package resolution fails or doesn't finish

Select **File > Packages > Reset Package Caches**, then build again. If the error persists, quit and reopen Xcode.

## Next steps

See the [iOS install guide](https://www.revenuecat.com/docs/getting-started/installation/ios) for your new setup, or the [iOS migration guides](https://www.revenuecat.com/docs/sdk-guides/ios-migration-guides-index) before upgrading to another major SDK version.
