Skip to main content
CocoaPods trunk stopped accepting new pod versions on December 2, 2026 (see CocoaPods trunk is read-only). Existing builds keep working, but a pod published only to trunk gets no more updates. This page moves a native iOS app to Swift Package Manager (SwiftPM). For Flutter, follow Flutter’s own Swift Package Manager guide; React Native still uses CocoaPods for its own pods. Do the move on a branch. Every step below ends in a build you can check.

1. List what you have

Write the list down with versions. Note anything in your Podfile that is not a plain pod 'Name', 'version' line: post_install hooks, use_frameworks!, build settings changed for specific pods, and :path or :git pods. Each of those needs its own replacement.

2. Find the Swift package for each pod

For each pod, open the project’s repository and look for a Package.swift at the root, or a section on Swift Package Manager in its README. Three outcomes:
  • Has a package. Note the repository URL and the product name(s). Product names can differ from pod names, and one pod can map to several products.
  • Has no package, but is small. Copy the source into your project, keeping its license file.
  • Has no package and is a binary SDK. Ask the vendor for an XCFramework. You can add an XCFramework to the target directly or wrap it in a local package with a binaryTarget.
Do not start removing CocoaPods until every pod has an answer.

3. Remove CocoaPods from the project

From the folder that contains the Podfile:
pod deintegrate removes the CocoaPods build phases, the Pods framework references and the .xcconfig includes from your .xcodeproj. Keep the Podfile until the migration is done so you can look up what was there. From now on, open the .xcodeproj, not the workspace. If your project had its own workspace for other reasons, delete only the CocoaPods entry from it instead.

4. Add the packages

In Xcode: File > Add Package Dependencies, paste the repository URL, choose a version rule, and add the products to the app target (and to extension targets that used the pod). Start with the version you had in Podfile.lock and upgrade later, so a build failure points at the migration and not at an upgrade. Packages are recorded in the project file and pinned in Package.resolved (inside the .xcodeproj or workspace). Commit Package.resolved, the same way you committed Podfile.lock.

5. Fix what the build tells you

Common errors after the switch:
  • No such module 'X': the product name differs from the pod’s module name, or the product was added to the wrong target.
  • Duplicate symbols: the same library is linked twice, often once as a package and once as a leftover framework in Link Binary With Libraries. Remove the leftover.
  • Missing resources (images, nibs, bundles): code that looked up resources with Bundle(for:) or by bundle name may need Bundle.module in the package, or a new release of the library.
  • Settings that lived in post_install: move them to the target’s build settings or an .xcconfig file you own.

6. Check the build on CI

Run the same commands your CI runs, from a clean checkout:
Any CI step that read Podfile.lock (for example to decide when to run pod install) should now read Package.resolved.

Check it on a Mac

Every step above ends in an Xcode build, which needs macOS. With box, box build builds the branch on a real Mac from any system, and box exec runs commands such as pod deintegrate or xcodebuild -resolvePackageDependencies there. See Build and Exec. Related: CocoaPods trunk is read-only, Fix “xcodebuild: command not found” on Linux CI, Cut GitHub Actions macOS minutes.