Documentation / 06
Commands
Run commands in the directory that contains the Podfile, or pass --project-directory DIR.
install
swiftpods install--resolve | Resolve packages with Xcode afterwards and check the result against the Podfile. |
|---|---|
--deployment | Require satisfying package pins and any used SwiftPods.lock; validate the complete graph without updating either lock. |
--adopt | Manage package references that were added without SwiftPods. |
--offline | Use cached binary archives and catalogs only. Xcode's package resolution has its own network requirements. |
--update-sources | Refresh unpinned catalogs and update SwiftPods.lock. Ignored with --deployment. |
--allow-external-file-lists | Explicitly trust Podfile-declared script file lists outside the Podfile directory. |
--project PATH | The Xcode project of targets that name none, in place of the only one next to the Podfile. deintegrate takes it too. |
Installation checks the Podfile, projects, binary checksums and pins before changing anything. A transaction journal supports rollback and recovery after interruption, and refuses to overwrite conflicting concurrent edits. A second install with nothing to change reports each project as up to date.
Locks and deployment
Package.resolved records Swift package versions and revisions. SwiftPods.lock records the catalog commit and entry checksum used for each catalog-backed declaration. Ordinary install reuses an existing catalog lock and creates a missing one; check can resolve missing catalog metadata in memory without writing a lock.
SwiftPods.lock stays next to the Podfile. Without it, each clean checkout resolves the catalog again, so the same name can select different metadata. Commit it when clean checkouts must reproduce that metadata, and whenever CI runs --deployment, which requires it. Explicit Git, local-path and binary-URL declarations need no catalog lock.
--deployment requires Package.resolved for Swift packages and SwiftPods.lock for catalog packages. It never creates or updates them, and fails if Xcode cannot validate the package graph or changes Package.resolved. With --deployment, --resolve adds nothing: deployment already validates the graph.
check
swiftpods checkReads the Podfile and lists what each target gets, without touching projects or writing SwiftPods.lock. --offline reads cached catalogs only. check --update-sources refreshes catalog metadata for this check while leaving the lock unchanged.
search
swiftpods search DatadogFinds packages in the public catalog, or in the one given with --source URL. --update-sources refreshes the catalog first. swiftpods catalog lint checks a catalog repository.
deintegrate
swiftpods deintegrateRemoves SwiftPods-owned package products, settings, scripts and generated files, preserving unknown files in SwiftPods/. swiftpods help lists its other cleanup options.
help and version
swiftpods help
swiftpods versionhelp lists every command and option, and version prints the version. Since SwiftPods 0.3.9, --help prints help wherever it appears. In earlier versions, --help after a command such as deintegrate runs that command, so use swiftpods help there.
Machine-readable output
Add --json for structured output. Diagnostics go to standard error; declaration errors include source locations when available. A failed command returns a nonzero exit status.