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

<!doctype html> 

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

[🖥️ Introducing the **Capacitor Electron Platform** — build desktop apps for macOS, Windows, and Linux. Free & open source. ](/blog/announcing-the-capacitor-electron-platform/) 

* [ SDKs ](/docs/sdks/)
* [ Formbricks ](/docs/sdks/capacitor/formbricks/)
* [ Geocoder ](/docs/sdks/capacitor/geocoder/)
* [ Google Sign-In ](/docs/sdks/capacitor/google-sign-in/)
* [ Grafana Faro ](/docs/sdks/capacitor/grafana-faro/)
* [ Gyroscope ](/docs/sdks/capacitor/gyroscope/)
* [ Haptics ](/docs/sdks/capacitor/haptics/)
* [ Home Indicator ](/docs/sdks/capacitor/home-indicator/)
* [ In-App Browser ](/docs/sdks/capacitor/in-app-browser/)
* [ Install Referrer ](/docs/sdks/capacitor/install-referrer/)
* [ Intercom ](/docs/sdks/capacitor/intercom/)
* [ Intune ](/docs/sdks/capacitor/intune/)
* [ Keep Awake ](/docs/sdks/capacitor/keep-awake/)
* [ libSQL ](/docs/sdks/capacitor/libsql/)
* [ Light Sensor ](/docs/sdks/capacitor/light-sensor/)
* [ Live Update ](/docs/sdks/capacitor/live-update/)
* [ Localization ](/docs/sdks/capacitor/localization/)
* [ Mail Composer ](/docs/sdks/capacitor/mail-composer/)
* [ Managed Configurations ](/docs/sdks/capacitor/managed-configurations/)
* [ Maps Launcher ](/docs/sdks/capacitor/maps-launcher/)
* [ Media Session ](/docs/sdks/capacitor/media-session/)
* [ ML Kit ](/docs/sdks/capacitor/mlkit/)
* [ Navigation Bar ](/docs/sdks/capacitor/navigation-bar/)
* [ Network ](/docs/sdks/capacitor/network/)
* [ NFC ](/docs/sdks/capacitor/nfc/)
* [ Node.js ](/docs/sdks/capacitor/nodejs/)
* [ OAuth ](/docs/sdks/capacitor/oauth/)
* [ Passkeys ](/docs/sdks/capacitor/passkeys/)
* [ Password Autofill ](/docs/sdks/capacitor/password-autofill/)
* [ PDF Generator ](/docs/sdks/capacitor/pdf-generator/)
* [ PDF Viewer ](/docs/sdks/capacitor/pdf-viewer/)
* [ Pedometer ](/docs/sdks/capacitor/pedometer/)
* [ Permissions ](/docs/sdks/capacitor/permissions/)
* [ Phone Dialer ](/docs/sdks/capacitor/phone-dialer/)
* [ Photo Editor ](/docs/sdks/capacitor/photo-editor/)
* [ Photo Manipulator ](/docs/sdks/capacitor/photo-manipulator/)
* [ PixLive ](/docs/sdks/capacitor/pixlive/)
* [ PostHog ](/docs/sdks/capacitor/posthog/)
* [ Printer ](/docs/sdks/capacitor/printer/)
* [ Privacy Screen ](/docs/sdks/capacitor/privacy-screen/)
* [ Proximity Sensor ](/docs/sdks/capacitor/proximity-sensor/)
* [ Purchases ](/docs/sdks/capacitor/purchases/)
* [ RealtimeKit ](/docs/sdks/capacitor/realtimekit/)
* [ Root Detection ](/docs/sdks/capacitor/root-detection/)
* [ Screen Brightness ](/docs/sdks/capacitor/screen-brightness/)
* [ Screen Orientation ](/docs/sdks/capacitor/screen-orientation/)
* [ Screen Reader ](/docs/sdks/capacitor/screen-reader/)
* [ Screenshot ](/docs/sdks/capacitor/screenshot/)
* [ Secure Preferences ](/docs/sdks/capacitor/secure-preferences/)
* [ Settings Launcher ](/docs/sdks/capacitor/settings-launcher/)
* [ Shake ](/docs/sdks/capacitor/shake/)
* [ Silent Mode ](/docs/sdks/capacitor/silent-mode/)
* [ SIM ](/docs/sdks/capacitor/sim/)
* [ SMS Composer ](/docs/sdks/capacitor/sms-composer/)
* [ Speech Recognition ](/docs/sdks/capacitor/speech-recognition/)
* [ Speech Synthesis ](/docs/sdks/capacitor/speech-synthesis/)
* [ Share Target ](/docs/sdks/capacitor/share-target/)
* [ Square Mobile Payments ](/docs/sdks/capacitor/square-mobile-payments/)
* [ SQLite ](/docs/sdks/capacitor/sqlite/)
* [ Superwall ](/docs/sdks/capacitor/superwall/)
* [ System WebView ](/docs/sdks/capacitor/system-webview/)
* [ Tauri ](/docs/sdks/capacitor/tauri/)
* [ Text Interaction ](/docs/sdks/capacitor/text-interaction/)
* [ Text Zoom ](/docs/sdks/capacitor/text-zoom/)
* [ Thermal State ](/docs/sdks/capacitor/thermal-state/)
* [ Toast ](/docs/sdks/capacitor/toast/)
* [ Torch ](/docs/sdks/capacitor/torch/)
* [ Vault ](/docs/sdks/capacitor/vault/)
* [ Volume ](/docs/sdks/capacitor/volume/)
* [ Wallet ](/docs/sdks/capacitor/wallet/)
* [ Wifi ](/docs/sdks/capacitor/wifi/)
* [ YouTube Player ](/docs/sdks/capacitor/youtube-player/)
* [ Zip ](/docs/sdks/capacitor/zip/)
* [ Cordova ](/docs/sdks/cordova/)
* [ Cloud ](/docs/cloud/)
* [ Integrations ](/docs/cloud/live-updates/integrations/)
* Concepts
* Reference
* [ Troubleshooting ](/docs/cloud/live-updates/troubleshooting/)
* [ FAQ ](/docs/cloud/live-updates/faq/)
* [ Native Builds ](/docs/cloud/native-builds/)
* [ Set Up Environments ](/docs/cloud/native-builds/environments/)
* [ Overwrite Native Configurations ](/docs/cloud/native-builds/native-configurations/)
* [ Auto-Increment Build Numbers ](/docs/cloud/native-builds/auto-incrementing-build-numbers/)
* [ Configure the Web Build Script ](/docs/cloud/native-builds/web-build-script/)
* [ Build from a Monorepo ](/docs/cloud/native-builds/monorepo/)
* [ Use pnpm, Yarn, or bun ](/docs/cloud/native-builds/package-managers/)
* [ Install Private npm Packages ](/docs/cloud/native-builds/npm-private-registry/)
* [ Override the Java Version ](/docs/cloud/native-builds/override-java-version/)
* [ Custom iOS Provisioning Profiles ](/docs/cloud/native-builds/custom-ios-provisioning-profiles/)
* [ Build without Git ](/docs/cloud/native-builds/build-without-git/)
* [ Access Git Behind a Firewall ](/docs/cloud/native-builds/firewall-access/)
* [ Integrations ](/docs/cloud/native-builds/integrations/)
* Reference
* [ Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [ FAQ ](/docs/cloud/native-builds/faq/)
* [ App Store Publishing ](/docs/cloud/app-store-publishing/)
* [ Submit a Build ](/docs/cloud/app-store-publishing/submit-a-build/)
* [ Submit Automatically After a Build ](/docs/cloud/app-store-publishing/submit-automatically/)
* [ Troubleshooting ](/docs/cloud/app-store-publishing/troubleshooting/)
* [ FAQ ](/docs/cloud/app-store-publishing/faq/)
* [ Automations ](/docs/cloud/automations/)
* [ Reference ](/docs/cloud/automations/reference/)
* [ Troubleshooting ](/docs/cloud/automations/troubleshooting/)
* [ FAQ ](/docs/cloud/automations/faq/)
* [ Assist ](/docs/cloud/assist/)
* [ CLI ](/docs/cloud/cli/)
* APIs and SDKs
* [ Webhooks ](/docs/cloud/webhooks/)
* [ Integrations ](/docs/cloud/integrations/)
* Account
* [ Organization ](/docs/cloud/organizations/)
* [ Two-Factor Enforcement ](/docs/cloud/organizations/two-factor-authentication/)
* [ Audit Logs ](/docs/cloud/organizations/audit-logs/)
* [ Billing ](/docs/cloud/organizations/billing/)
* [ License Keys ](/docs/cloud/license-keys/)
* [ AI ](/docs/ai/)
* [ Insiders ](/docs/insiders/)
* [ Billing & Plans ](/docs/insiders/billing-and-plans/)
* [ FAQ ](/docs/insiders/faq/)
* [ License ](https://capawesome.io/legal/eula/)
* [ Support ](/docs/support/)
* [ Contributing ](/docs/contributing/)
* Contributing code
* [ Code of Conduct ](/docs/contributing/code-of-conduct/)
* [ Questions ](https://docs.github.com/en/discussions/collaborating-with-your-community-using-discussions/participating-in-a-discussion#creating-a-discussion)
* [ Blog ](/blog/)
* Categories

* [ What to Back Up Before Migrating ](#what-to-back-up-before-migrating)
* [ Migration Options ](#migration-options)
* [ FAQ ](#faq)
* [ 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](https://capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.png?t=1) ](https://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.

## FAQ[¶](#faq "Permanent link")

### Can I keep using CocoaPods for some plugins and SPM for others?[¶](#can-i-keep-using-cocoapods-for-some-plugins-and-spm-for-others "Permanent link")

No — this is the single hardest requirement of the migration. You cannot mix SPM and CocoaPods in one Capacitor app; every Capacitor and Cordova plugin in your `package.json` needs SPM support before you switch. A single holdout plugin without SPM support blocks the whole migration until it's updated or replaced.

### Will I lose my custom native code and Xcode project settings during migration?[¶](#will-i-lose-my-custom-native-code-and-xcode-project-settings-during-migration "Permanent link")

Only if you don't back them up first. The cleanest migration path deletes the entire `ios/` folder and re-scaffolds it from scratch, which wipes out anything you've customized — `AppDelegate.swift`, entitlements, custom `.xcconfig` files, signing configuration, and any additional native source files. That's exactly why the guide lists a specific backup checklist before starting; skipping it means losing that work permanently.

### What if my Xcode project has a lot of manual customization — should I still use the automated assistant?[¶](#what-if-my-xcode-project-has-a-lot-of-manual-customization-should-i-still-use-the-automated-assistant "Permanent link")

Probably not as-is. The `npx cap spm-migration-assistant` command works best on unmodified Xcode projects; heavy native customization typically means fixing things up by hand afterward regardless of which automated path you take. In that case, either the Capawesome Skills option (which walks through restoring your customizations interactively) or the fully manual migration — where you control every step — tends to be more predictable.

### Do I need to manually edit `CapApp-SPM` after migrating?[¶](#do-i-need-to-manually-edit-capapp-spm-after-migrating "Permanent link")

No, and you shouldn't. `CapApp-SPM` is a local Swift package that the Capacitor CLI updates automatically every time you run `npx cap sync` — it's the SPM-based replacement for the old `Podfile`, and it's meant to be a generated artifact, not something you hand-edit.

### If I maintain a plugin that doesn't support SPM yet, does that block my app's migration entirely?[¶](#if-i-maintain-a-plugin-that-doesnt-support-spm-yet-does-that-block-my-apps-migration-entirely "Permanent link")

Yes, until you add SPM support to it or replace it with an alternative. Since a Capacitor app can't mix dependency managers, one plugin lacking SPM support is enough to block the whole app migration — see [How to Migrate a Capacitor Plugin to Swift Package Manager](/blog/how-to-migrate-a-capacitor-plugin-to-spm/) if that plugin is one you maintain yourself.

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

If you're shipping Capacitor apps, [Capawesome Cloud](https://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://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://capawesome.io/newsletter/).

July 17, 2026 

Back to top

```json
{
      "@context": "https://schema.org",
      "@type": "BlogPosting",
      "headline": "How to Migrate a Capacitor App to Swift Package Manager",
      "description": "Learn how to migrate your Capacitor app\u0027s iOS dependency management from CocoaPods to Swift Package Manager (SPM) with three proven approaches.",
      "image": "https://capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.png",
      "datePublished": "2026-04-30T00:00:00+00:00",
      "dateModified": "2026-07-17T00:00:00+00:00",
      "author": [
        {
          "@type": "Person",
          "name": "Robin Genz",
          "url": "https://github.com/robingenz"
        }
      ],
      "publisher": {
        "@type": "Organization",
        "name": "Capawesome",
        "url": "https://capawesome.io",
        "logo": {
          "@type": "ImageObject",
          "url": "https://capawesome.io/assets/images/logo.svg"
        }
      },
      "articleSection": "Capacitor",
      "keywords": ["Capacitor", "Guides"],
      "isPartOf": {
        "@type": "Blog",
        "@id": "https://capawesome.io/blog/#blog"
      },
      "mainEntityOfPage": "https://capawesome.io/blog/how-to-migrate-a-capacitor-app-to-spm/",
      "url": "https://capawesome.io/blog/how-to-migrate-a-capacitor-app-to-spm/"
    }
{
      "@context": "https://schema.org",
      "@type": "BreadcrumbList",
      "itemListElement": [
        {
          "@type": "ListItem",
          "position": 1,
          "name": "Home",
          "item": "https://capawesome.io/"
        },
        {
          "@type": "ListItem",
          "position": 2,
          "name": "Blog",
          "item": "https://capawesome.io/blog/"
        },
        {
          "@type": "ListItem",
          "position": 3,
          "name": "How to Migrate a Capacitor App to Swift Package Manager",
          "item": "https://capawesome.io/blog/how-to-migrate-a-capacitor-app-to-spm/"
        }
      ]
    }
{"@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [{"@type": "Question", "name": "Can I keep using CocoaPods for some plugins and SPM for others?", "acceptedAnswer": {"@type": "Answer", "text": "No — this is the single hardest requirement of the migration. You cannot mix SPM and CocoaPods in one Capacitor app; every Capacitor and Cordova plugin in your package.json needs SPM support before you switch. A single holdout plugin without SPM support blocks the whole migration until it's updated or replaced."}}, {"@type": "Question", "name": "Will I lose my custom native code and Xcode project settings during migration?", "acceptedAnswer": {"@type": "Answer", "text": "Only if you don't back them up first. The cleanest migration path deletes the entire ios/ folder and re-scaffolds it from scratch, which wipes out anything you've customized — AppDelegate.swift, entitlements, custom.xcconfig files, signing configuration, and any additional native source files. That's exactly why the guide lists a specific backup checklist before starting; skipping it means losing that work permanently."}}, {"@type": "Question", "name": "What if my Xcode project has a lot of manual customization — should I still use the automated assistant?", "acceptedAnswer": {"@type": "Answer", "text": "Probably not as-is. The npx cap spm-migration-assistant command works best on unmodified Xcode projects; heavy native customization typically means fixing things up by hand afterward regardless of which automated path you take. In that case, either the Capawesome Skills option (which walks through restoring your customizations interactively) or the fully manual migration — where you control every step — tends to be more predictable."}}, {"@type": "Question", "name": "Do I need to manually edit CapApp-SPM after migrating?", "acceptedAnswer": {"@type": "Answer", "text": "No, and you shouldn't. CapApp-SPM is a local Swift package that the Capacitor CLI updates automatically every time you run npx cap sync — it's the SPM-based replacement for the old Podfile, and it's meant to be a generated artifact, not something you hand-edit."}}, {"@type": "Question", "name": "If I maintain a plugin that doesn't support SPM yet, does that block my app's migration entirely?", "acceptedAnswer": {"@type": "Answer", "text": "Yes, until you add SPM support to it or replace it with an alternative. Since a Capacitor app can't mix dependency managers, one plugin lacking SPM support is enough to block the whole app migration — see How to Migrate a Capacitor Plugin to Swift Package Manager if that plugin is one you maintain yourself."}}], "url": "https://capawesome.io/blog/how-to-migrate-a-capacitor-app-to-spm/"}
```
