---
description: Learn how to migrate your Capacitor app's iOS dependency management from CocoaPods to Swift Package Manager (SPM) with three proven approaches.
title: How to Migrate a Capacitor App to Swift Package Manager - Capawesome
image: https://capawesome.io/docs/assets/images/social/blog/how-to-migrate-a-capacitor-app-to-spm.png
---

[ Skip to content](#how-to-migrate-a-capacitor-app-to-swift-package-manager) 

[ 🎉 Introducing **Capawesome Platform** — one platform for Live Updates, Native Builds, App Store Publishing, and Insider SDKs.](https://capawesome.io) 

* [  Formbricks ](/docs/plugins/formbricks/)
* [  Geocoder ](/docs/plugins/geocoder/)
* [  Google Sign-In ](/docs/plugins/google-sign-in/)
* [  libSQL ](/docs/plugins/libsql/)
* [  Live Update ](/docs/plugins/live-update/)
* [  Managed Configurations ](/docs/plugins/managed-configurations/)
* [  Media Session ](/docs/plugins/media-session/)
* [  ML Kit ](/docs/plugins/mlkit/)
* [  NFC ](/docs/plugins/nfc/)
* [  OAuth ](/docs/plugins/oauth/)
* [  Pedometer ](/docs/plugins/pedometer/)
* [  Photo Editor ](/docs/plugins/photo-editor/)
* [  PostHog ](/docs/plugins/posthog/)
* [  Printer ](/docs/plugins/printer/)
* [  Purchases ](/docs/plugins/purchases/)
* [  RealtimeKit ](/docs/plugins/realtimekit/)
* [  Screen Orientation ](/docs/plugins/screen-orientation/)
* [  Screenshot ](/docs/plugins/screenshot/)
* [  Secure Preferences ](/docs/plugins/secure-preferences/)
* [  Speech Recognition ](/docs/plugins/speech-recognition/)
* [  Speech Synthesis ](/docs/plugins/speech-synthesis/)
* [  Share Target ](/docs/plugins/share-target/)
* [  Square Mobile Payments ](/docs/plugins/square-mobile-payments/)
* [  SQLite ](/docs/plugins/sqlite/)
* [  Superwall ](/docs/plugins/superwall/)
* [  Torch ](/docs/plugins/torch/)
* [  Wifi ](/docs/plugins/wifi/)
* [  Zip ](/docs/plugins/zip/)
* [  Cloud ](/docs/cloud/)
* [  Live Updates ](/docs/cloud/live-updates/)
* Advanced
* Integrations
* [  Native Builds ](/docs/cloud/native-builds/)
* [  Configuration ](/docs/cloud/native-builds/configuration/)
* [  Environments ](/docs/cloud/native-builds/environments/)
* Guides
* [  Sample Projects ](/docs/cloud/native-builds/sample-projects/)
* [  Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [  Automations ](/docs/cloud/automations/)
* [  Assist ](/docs/cloud/assist/)
* Account
* Organizations
* [  Organization and User Management ](/docs/cloud/organizations/memberships/)
* [  Single Sign-On (SSO) ](/docs/cloud/organizations/sso/)
* [  Teams ](/docs/cloud/organizations/teams/)
* [  Two-Factor Authentication ](/docs/cloud/organizations/two-factor-authentication/)
* [  Integrations ](/docs/cloud/integrations/)
* [  License Keys ](/docs/cloud/license-keys/)
* [  Webhooks ](/docs/cloud/webhooks/)
* [  Pricing ](https://capawesome.io/pricing/)
* [  FAQ ](/docs/cloud/faq/)
* [  Support ](/docs/cloud/support/)
* [  Contributing ](/docs/contributing/)
* [  LLMs ](/docs/llms/)
* [  Insiders ](/docs/insiders/)
* [  License ](https://capawesome.io/legal/eula/)
* [  Support ](/docs/insiders/support/)
* [  FAQ ](/docs/insiders/faq/)
* [  Blog ](/blog/)
* Categories

* [  What to Back Up Before Migrating ](#what-to-back-up-before-migrating)
* [  Migration Options ](#migration-options)
* [  Try Capawesome Cloud ](#try-capawesome-cloud)
* [  Conclusion ](#conclusion)

# How to Migrate a Capacitor App to Swift Package Manager[¶](#how-to-migrate-a-capacitor-app-to-swift-package-manager "Permanent link")

Capacitor 8 made Swift Package Manager (SPM) the default dependency manager for new iOS projects, and CocoaPods is officially in maintenance mode. If you maintain an existing Capacitor app on CocoaPods, migrating to SPM is the path forward. This post walks you through what changes on the iOS side and three ways to perform the migration.

[ ![Build and deploy your Capacitor app with Capawesome Cloud](../../assets/external/cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.69628c3f.png) ](https://cloud.capawesome.io/) 

## What Changes Are Needed[¶](#what-changes-are-needed "Permanent link")

Migrating a Capacitor app from CocoaPods to SPM replaces the entire iOS dependency layer. Here's what changes at a high level.

### CapApp-SPM Replaces the Podfile[¶](#capapp-spm-replaces-the-podfile "Permanent link")

In a CocoaPods-based Capacitor app, plugin dependencies live in the `ios/App/Podfile`. With SPM, that file is gone. Instead, Capacitor uses a local Swift package called `CapApp-SPM` as the central reference point for all plugin dependencies. The Capacitor CLI updates this package automatically when you run `npx cap sync`, so you should not edit it by hand.

### A New debug.xcconfig Is Generated[¶](#a-new-debugxcconfig-is-generated "Permanent link")

The SPM setup ships a generated `debug.xcconfig` file that needs to be added to your Xcode project. It carries the build settings that the old `Pods.xcconfig` used to provide.

### All Plugins Must Support SPM[¶](#all-plugins-must-support-spm "Permanent link")

You cannot mix SPM and CocoaPods in a single Capacitor app. Every Capacitor and Cordova plugin in your `package.json` must offer SPM support before you migrate. Most official and Capawesome plugins already do, but third-party plugins might not. If you maintain a plugin yourself, see [How to Migrate a Capacitor Plugin to Swift Package Manager](/blog/how-to-migrate-a-capacitor-plugin-to-spm/).

## What to Back Up Before Migrating[¶](#what-to-back-up-before-migrating "Permanent link")

The cleanest migration path involves deleting the existing `ios/` folder and re-scaffolding it. That means any customization you've made to the native project will be lost unless you preserve it. Before you start, back up the following files from `ios/App/`:

* `App/Info.plist`
* `App/AppDelegate.swift` (and `SceneDelegate.swift` if present)
* `App/Assets.xcassets/`
* `App/Base.lproj/`
* `App/App.entitlements`
* `App/GoogleService-Info.plist` (if you use Firebase)
* Any custom `.xcconfig` files
* Signing configuration (team ID, bundle identifier, provisioning profile settings)

If your project contains additional native Swift or Objective-C source files, custom frameworks, or third-party SDK files outside of plugins, back those up as well. Always commit your changes to source control before starting the migration so you have a clean rollback point.

## Migration Options[¶](#migration-options "Permanent link")

You have three ways to perform the migration. The recommended option depends on how comfortable you are running an AI coding agent against your project.

### Option 1: Capawesome Skills (Recommended)[¶](#option-1-capawesome-skills-recommended "Permanent link")

[Capawesome Skills](https://github.com/capawesome-team/skills) is a collection of open source AI agent skills for [Claude Code](https://docs.anthropic.com/en/docs/claude-code) and other AI coding agents. It includes a dedicated `capacitor-app-spm-migration` skill that drives the full migration end to end: it checks prerequisites, inventories your installed plugins, backs up the customized iOS files listed above, deletes the existing `ios/` folder, re-scaffolds it with SPM, restores the preserved files, re-syncs plugins, and verifies the build.

Install the skills:

`[](#%5F%5Fcodelineno-0-1)npx skills add capawesome-team/skills
`

Then prompt your AI agent:

`[](#%5F%5Fcodelineno-1-1)Migrate my Capacitor app to Swift Package Manager.
`

The agent walks through each step interactively and adapts to your app's specific setup. This is the recommended option because it removes most of the manual file shuffling while still keeping you in control of every change.

### Option 2: npx cap spm-migration-assistant[¶](#option-2-npx-cap-spm-migration-assistant "Permanent link")

The Capacitor CLI ships an interactive migration assistant that automates parts of the process:

`[](#%5F%5Fcodelineno-2-1)npx cap spm-migration-assistant
`

The assistant removes the CocoaPods infrastructure, generates a `Package.swift` from your installed plugins, and creates the configuration files needed by SPM. After it finishes, you still need to open the Xcode project and complete a few manual steps:

`[](#%5F%5Fcodelineno-3-1)npx cap open ios
`

In Xcode, add `CapApp-SPM` as a local package dependency and add the generated `debug.xcconfig` to your project. The assistant prints the exact paths to use.

A few things to keep in mind:

* The assistant works best on unmodified Xcode projects. If you have heavy native customization, expect to fix things up by hand afterwards.
* Plugins that don't ship SPM support will cause the migration to fail. Update or replace them before running the assistant.
* Always commit your changes to source control before running the assistant.

### Option 3: Manual Migration[¶](#option-3-manual-migration "Permanent link")

If your Xcode project has not been customized, the cleanest manual approach is to delete the `ios/` folder and let the Capacitor CLI scaffold a fresh SPM-based project:

`[](#%5F%5Fcodelineno-4-1)rm -rf ios
[](#%5F%5Fcodelineno-4-2)npx cap add ios --packagemanager SPM
[](#%5F%5Fcodelineno-4-3)npx cap sync
`

After re-scaffolding, restore the files you backed up earlier (`Info.plist`, `AppDelegate.swift`, `Assets.xcassets`, `Base.lproj`, `App.entitlements`, `GoogleService-Info.plist`, custom `.xcconfig` files, and signing configuration). Then open the project in Xcode and verify that it builds and runs:

`[](#%5F%5Fcodelineno-5-1)npx cap open ios
`

This approach gives you full control but requires the most attention to detail. It's a good fit if you prefer to understand every change or if the other two options ran into issues with your project.

## Try Capawesome Cloud[¶](#try-capawesome-cloud "Permanent link")

If you're shipping Capacitor apps, [Capawesome Cloud](https://cloud.capawesome.io/) can help you ship faster with cloud-based native builds, over-the-air updates, and automated app store publishing — all of which work seamlessly with both CocoaPods and SPM-based projects.

[Try Capawesome Cloud Free](https://cloud.capawesome.io)

## Conclusion[¶](#conclusion "Permanent link")

Migrating a Capacitor app to Swift Package Manager is mostly a matter of replacing the CocoaPods layer with `CapApp-SPM` and a generated `debug.xcconfig`. With the `capacitor-app-spm-migration` skill, the official `npx cap spm-migration-assistant`, or a manual re-scaffold, you have three solid paths to choose from. Make sure all your plugins support SPM, back up your customized iOS files, and pick the option that matches your comfort level.

If you maintain your own Capacitor plugin, take a look at [How to Migrate a Capacitor Plugin to Swift Package Manager](/blog/how-to-migrate-a-capacitor-plugin-to-spm/) for the plugin-side counterpart to this guide. If you still need CocoaPods for your project, see [How to Use CocoaPods Instead of SPM with Capacitor](/blog/how-to-use-cocoapods-with-capacitor/).

If you have questions, feel free to join the [Capawesome Discord server](https://discord.gg/VCXxSVjefW). To stay up to date with the latest news, subscribe to the [Capawesome newsletter](https://cloud.capawesome.io/newsletter).

April 30, 2026 

 Back to top 