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

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

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

* [  Setting Up CocoaPods ](#setting-up-cocoapods)
* [  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](../../assets/external/cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.69628c3f.png) ](/) 

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

## 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/).

May 7, 2026 

 Back to top 