---
description: Learn when and how to use CocoaPods as the iOS package manager in Capacitor 8 projects to work around common SPM limitations.
title: How to Use CocoaPods Instead of SPM with Capacitor - Capawesome
image: https://capawesome.io/docs/assets/images/social/blog/how-to-use-cocoapods-with-capacitor.png
---

<!doctype html> 

[Skip to content ](#how-to-use-cocoapods-instead-of-spm-with-capacitor) 

[🖥️ 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

* [ Setting Up CocoaPods ](#setting-up-cocoapods)
* [ FAQ ](#faq)
* [ Related Posts ](#related-posts)
* [ Try Capawesome Cloud ](#try-capawesome-cloud)
* [ Conclusion ](#conclusion)

# How to Use CocoaPods Instead of SPM with Capacitor[¶](#how-to-use-cocoapods-instead-of-spm-with-capacitor "Permanent link")

Capacitor 8 made Swift Package Manager (SPM) the default dependency manager for new iOS projects. While SPM is the future of iOS dependency management, it still has some rough edges that can block real-world projects. In those cases, CocoaPods remains a solid alternative. This post covers when you might want to stick with CocoaPods and how to set it up.

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

## Why SPM Is the Default[¶](#why-spm-is-the-default "Permanent link")

When the Ionic team [announced Capacitor 8](https://ionic.io/blog/announcing-capacitor-8), one of the headline changes was adopting SPM as the default package manager for iOS. This aligns with the broader iOS ecosystem trend: CocoaPods [entered maintenance mode](https://blog.cocoapods.org/CocoaPods-Specs-Repo-Rate-Limiting/) in August 2024, and its Specs repository will become read-only in December 2026\. Apple has been pushing SPM as the official replacement, and most first-party frameworks already ship with SPM support.

For many projects, SPM works well out of the box. But SPM is still maturing, and there are cases where it falls short.

## When CocoaPods Is the Better Choice[¶](#when-cocoapods-is-the-better-choice "Permanent link")

Here are two real-world examples where SPM limitations can cause issues in Capacitor projects:

### Package Identity Collisions[¶](#package-identity-collisions "Permanent link")

SPM determines a package's identity based on its path or URL. When Capacitor generates the `Package.swift` for your project, this can lead to identity collisions where two unrelated packages end up with the same identity. Depending on the Xcode version, this may cause warnings or hard build errors.

See [capawesome-team/capacitor-firebase#959](https://github.com/capawesome-team/capacitor-firebase/issues/959) for a concrete example.

### Missing Support for Package Traits[¶](#missing-support-for-package-traits "Permanent link")

Swift 6.1 introduced [Package Traits (SE-0450)](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0450-swiftpm-package-traits.md), which allow package authors to define optional, toggleable dependencies. A practical example: the Firebase Analytics SDK offers a variant with IDFA/Ad ID collection support and one without. CocoaPods handled this cleanly via subspecs, and SPM package traits are the intended replacement.

However, since Capacitor generates the `Package.swift` on behalf of the developer, there is currently no way to pass traits to plugin dependencies. Until Capacitor adds support for this (tracked in [ionic-team/capacitor#8335](https://github.com/ionic-team/capacitor/issues/8335)), projects that need to toggle SDK features like IDFA support are better off using CocoaPods.

### Other Considerations[¶](#other-considerations "Permanent link")

Beyond these specific issues, there are a few more reasons to prefer CocoaPods:

* **Third-party plugin support**: Not all Capacitor plugins have added SPM support yet. If a plugin you depend on only ships a `.podspec`, you need CocoaPods.
* **Mixed Objective-C/Swift plugins**: SPM does not allow mixing Objective-C and Swift in the same target. Plugins that rely on this pattern require CocoaPods.
* **You cannot mix SPM and CocoaPods**: This is a hard constraint. If even one of your dependencies requires CocoaPods, your entire project needs to use CocoaPods.

## Setting Up CocoaPods[¶](#setting-up-cocoapods "Permanent link")

Using CocoaPods with Capacitor 8 is straightforward. When adding the iOS platform to your project, pass the `--packagemanager` flag with the value `cocoapods`:

`[](#%5F%5Fcodelineno-0-1)npx cap add ios --packagemanager cocoapods
`

That's it. Capacitor will generate the iOS project with a `Podfile` instead of a `Package.swift`, and all plugin dependencies will be resolved through CocoaPods.

If you already have an iOS project using SPM and want to switch to CocoaPods, you'll need to remove the existing iOS project first and re-add it:

`[](#%5F%5Fcodelineno-1-1)npx cap rm ios
[](#%5F%5Fcodelineno-1-2)npx cap add ios --packagemanager cocoapods
`

Make sure to back up any custom native code before removing the platform.

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

### Is staying on CocoaPods indefinitely a reasonable long-term choice, or just a stopgap?[¶](#is-staying-on-cocoapods-indefinitely-a-reasonable-long-term-choice-or-just-a-stopgap "Permanent link")

Treat it as a stopgap tied to your specific blocker, not a permanent choice. CocoaPods entered maintenance mode in August 2024, and its Specs repository becomes read-only in December 2026 — so while it works reliably today, it's not where the ecosystem is investing going forward. Revisit the decision once your specific blocker (a missing plugin's SPM support, package trait support landing in Capacitor) is resolved, rather than treating the switch to CocoaPods as a one-time decision you never reconsider.

### If a plugin only ships a `.podspec`, is there any way to use it with an SPM project?[¶](#if-a-plugin-only-ships-a-podspec-is-there-any-way-to-use-it-with-an-spm-project "Permanent link")

Not without the plugin author adding SPM support first. A plugin that only ships a `.podspec` has no SPM manifest for Capacitor to reference, so a project on SPM simply can't consume it — your options are switching your whole project to CocoaPods, asking the plugin author to add SPM support, or finding an alternative plugin that already has it.

### Does switching to CocoaPods lose me the option to switch back to SPM later?[¶](#does-switching-to-cocoapods-lose-me-the-option-to-switch-back-to-spm-later "Permanent link")

No, but it's not instant — switching back requires removing and re-adding the iOS platform (`npx cap rm ios` followed by `npx cap add ios`), the same as the CocoaPods-to-SPM direction. Back up any custom native code before doing this either way, since re-adding the platform regenerates the project from scratch.

### Are package identity collisions a Capacitor bug, or an SPM limitation?[¶](#are-package-identity-collisions-a-capacitor-bug-or-an-spm-limitation "Permanent link")

It's rooted in how SPM itself determines package identity — based on path or URL — combined with how Capacitor generates `Package.swift` on your behalf. Depending on your Xcode version, this can surface as warnings or hard build errors when two unrelated packages end up sharing an identity; it's a known, tracked issue rather than something you're doing wrong in your own config.

### Will Capacitor eventually support SPM package traits well enough that I don't need CocoaPods for that reason anymore?[¶](#will-capacitor-eventually-support-spm-package-traits-well-enough-that-i-dont-need-cocoapods-for-that-reason-anymore "Permanent link")

That's the intended direction, but it's not there yet. Since Capacitor generates `Package.swift` automatically, there's currently no way to pass traits through to plugin dependencies — this is tracked as an open issue ([ionic-team/capacitor#8335](https://github.com/ionic-team/capacitor/issues/8335)), so until it lands, projects that need toggleable SDK features (like IDFA support variants) still need CocoaPods for that specific use case.

## Related Posts[¶](#related-posts "Permanent link")

* [How to Migrate a Capacitor App to Swift Package Manager](/blog/how-to-migrate-a-capacitor-app-to-spm/)
* [How to Migrate a Capacitor Plugin to SPM](/blog/how-to-migrate-a-capacitor-plugin-to-spm/)
* [How to Use SPM Package Traits in Capacitor 8](/blog/how-to-use-spm-package-traits-in-capacitor/)

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

If you're building Capacitor apps, [Capawesome Cloud](/) can help you ship faster with cloud-based native builds, over-the-air updates, and more.

[Try Capawesome Cloud Free](/)

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

SPM is the direction Apple and the Capacitor team are heading, and it's the right default for most new projects. But it's still evolving, and edge cases like package identity collisions and missing package trait support can be real blockers. When you hit one of these issues, CocoaPods is a proven fallback that works reliably with Capacitor 8.

If you haven't upgraded yet, check out [How to Upgrade Your Capacitor App to Capacitor 8](/blog/how-to-upgrade-your-capacitor-app-to-capacitor-8/) for a full walkthrough of all migration approaches.

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](/newsletter/).

July 17, 2026 

Back to top

```json
{
      "@context": "https://schema.org",
      "@type": "BlogPosting",
      "headline": "How to Use CocoaPods Instead of SPM with Capacitor",
      "description": "Learn when and how to use CocoaPods as the iOS package manager in Capacitor 8 projects to work around common SPM limitations.",
      "image": "https://capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.png",
      "datePublished": "2026-03-12T00: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-use-cocoapods-with-capacitor/",
      "url": "https://capawesome.io/blog/how-to-use-cocoapods-with-capacitor/"
    }
{
      "@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 Use CocoaPods Instead of SPM with Capacitor",
          "item": "https://capawesome.io/blog/how-to-use-cocoapods-with-capacitor/"
        }
      ]
    }
{"@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [{"@type": "Question", "name": "Is staying on CocoaPods indefinitely a reasonable long-term choice, or just a stopgap?", "acceptedAnswer": {"@type": "Answer", "text": "Treat it as a stopgap tied to your specific blocker, not a permanent choice. CocoaPods entered maintenance mode in August 2024, and its Specs repository becomes read-only in December 2026 — so while it works reliably today, it's not where the ecosystem is investing going forward. Revisit the decision once your specific blocker (a missing plugin's SPM support, package trait support landing in Capacitor) is resolved, rather than treating the switch to CocoaPods as a one-time decision you never reconsider."}}, {"@type": "Question", "name": "If a plugin only ships a.podspec, is there any way to use it with an SPM project?", "acceptedAnswer": {"@type": "Answer", "text": "Not without the plugin author adding SPM support first. A plugin that only ships a.podspec has no SPM manifest for Capacitor to reference, so a project on SPM simply can't consume it — your options are switching your whole project to CocoaPods, asking the plugin author to add SPM support, or finding an alternative plugin that already has it."}}, {"@type": "Question", "name": "Does switching to CocoaPods lose me the option to switch back to SPM later?", "acceptedAnswer": {"@type": "Answer", "text": "No, but it's not instant — switching back requires removing and re-adding the iOS platform ( npx cap rm ios followed by npx cap add ios), the same as the CocoaPods-to-SPM direction. Back up any custom native code before doing this either way, since re-adding the platform regenerates the project from scratch."}}, {"@type": "Question", "name": "Are package identity collisions a Capacitor bug, or an SPM limitation?", "acceptedAnswer": {"@type": "Answer", "text": "It's rooted in how SPM itself determines package identity — based on path or URL — combined with how Capacitor generates Package.swift on your behalf. Depending on your Xcode version, this can surface as warnings or hard build errors when two unrelated packages end up sharing an identity; it's a known, tracked issue rather than something you're doing wrong in your own config."}}, {"@type": "Question", "name": "Will Capacitor eventually support SPM package traits well enough that I don't need CocoaPods for that reason anymore?", "acceptedAnswer": {"@type": "Answer", "text": "That's the intended direction, but it's not there yet. Since Capacitor generates Package.swift automatically, there's currently no way to pass traits through to plugin dependencies — this is tracked as an open issue ( ionic-team/capacitor#8335), so until it lands, projects that need toggleable SDK features (like IDFA support variants) still need CocoaPods for that specific use case."}}], "url": "https://capawesome.io/blog/how-to-use-cocoapods-with-capacitor/"}
```
