Safeguard
Developer Tools•

How do you migrate from CocoaPods to SwiftPM without losing visibility?

A step by step checklist for moving an iOS app from CocoaPods to Swift Package Manager while keeping an accurate record of every dependency and version.

Safeguard Security Team
3 min read

Migrate in small steps and record the before and after. Export the current pod versions from your lock file, move one dependency at a time to a Swift package at the same version, and compare lists after each step. That way you never lose track of what ships or which advisories apply.

Why migrations lose visibility

Moving package managers changes where versions are written down. CocoaPods records installed versions in Podfile.lock. Swift Package Manager records them in its own resolved file. During a move, a library can quietly change version, switch to a different fork, or gain new transitive packages. If nobody compared the lists, you find out after release.

Step by step

  1. Snapshot the current state. Save Podfile.lock and a list of pod names with versions. This is your baseline.
  2. Check availability. For each pod, confirm the upstream project publishes a Swift package. Do not assume a third party mirror is the same code.
  3. Match versions first. Add the package at the version you already ship, using a version requirement such as from. Upgrading during migration mixes two changes and makes problems hard to trace.
  4. Remove one pod at a time. Delete it from the Podfile, run pod install, add the package, build, and test.
  5. Compare lists. After each move, list your dependencies again and diff against the baseline. Look for new transitive packages.
  6. Check source URLs. A Swift package is identified by its repository URL. Confirm it is the maintainer's own repository.
  7. Handle binary pods. If a pod ships a prebuilt framework, see how SwiftPM treats a binary SDK and its checksum.
  8. Commit the new resolved file and remove the Pods artifacts you no longer use.
  9. Keep the old lock file in history so an audit can reconstruct what shipped before the move.

What to watch for

RiskCheck
Version driftCompare against the baseline after each step
Look alike repositoriesVerify the URL belongs to the maintainer
Hidden transitive packagesRe-list dependencies after each change
Pods with build scriptsReview what the script did and whether SwiftPM needs an equivalent

CocoaPods guidance says to always commit Podfile.lock, and the same habit applies to the Swift resolved file.

Try it yourself

Click through it at your own pace, or open it full screen. Use it to picture the before and after inventory you want to compare.

Safeguard builds an SBOM and scans your dependencies for known vulnerabilities, and you can run a free scan at gold.safeguard.sh/scan to see what your own project pulls in.

Quick check

Should I migrate and upgrade at the same time?

No. Match versions first, then upgrade as a separate change so any new problem has one cause.

How do I know a Swift package is the real one?

Check that the repository URL is the maintainer's own, and compare the version and tag history with what you used as a pod.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.