Swift packages, declared.

Declare Swift packages and prebuilt binary SDKs in one Podfile, with a Ruby-like DSL. SwiftPods integrates them into your Xcode project; Xcode handles dependency resolution and builds.

  • Release on GitHub
  • macOS 13 or later
  • Apple Silicon and Intel
  • Signed and notarized
  • iOS · macOS · tvOS · watchOS · visionOS

Install

Homebrew

brew tap swiftpods-org/swiftpods https://github.com/swiftpods-org/swiftpods.git
brew install swiftpods-org/swiftpods/swiftpods

Add the tap once, then install the fully qualified formula. Update with brew upgrade swiftpods-org/swiftpods/swiftpods.

Pinned installer

bash -o pipefail -c 'curl -fsSL https://swiftpods.org/install.sh | bash -s -- --version <version> --installer-sha256 <installer-sha256> --manifest-sha256 <manifest-sha256>'

For GitLab CI, Jenkins and other macOS runners. It verifies the release manifest, archive and Apple signing identity, and needs Python 3.9 or later but no Homebrew. See CI setup.

GitHub Actions

- uses: swiftpods-org/swiftpods@<commit>
  with:
    version: '<version>'
    manifest-sha256: '<manifest-sha256>'
- run: swiftpods install --deployment

Wraps the same installer and adds SwiftPods to PATH. Use a macOS runner with Python 3.9 or later and your project's Xcode.

Fastlane

gem 'fastlane-plugin-swiftpods',
    git: 'https://github.com/swiftpods-org/swiftpods.git',
    tag: 'fastlane-v<version>'

Add the plugin to fastlane/Pluginfile, run bundle install and commit Gemfile.lock. See plugin options.

The version, checksums and commit come from the latest release on GitHub. Release archives and source builds: Downloads.

Quick start

  1. Place a Podfile next to your Xcode project.

    platform :ios, '15.0'
    
    target 'MyApp' do
      spm 'https://github.com/Alamofire/Alamofire.git', '~> 5.9'
      spm 'Networking', path: 'Modules/Networking'
      binary 'AdsSDK', url: 'https://example.com/AdsSDK-2.1.0.zip',
                       sha256: '3f1c…', linker_flags: ['-ObjC']
    
      target 'MyAppTests' do
        spm 'https://github.com/pointfreeco/swift-snapshot-testing.git', exact: '1.18.0',
            products: ['SnapshotTesting']
      end
    end

    MyAppTests is nested, so it also links what MyApp declares. 3f1c… stands for the archive's complete SHA-256.

  2. Check what each target gets before changing the project.

    swiftpods check
  3. Install, then open the .xcodeproj as usual and build.

    swiftpods install --resolve

    Each target gets its Swift package products, a generated binary container product, a settings file and the [SwiftPods] Prepare and [SwiftPods] Finish phases. --resolve asks Xcode to resolve versions into Package.resolved.

The Podfile at a glance

StatementWhat it declares
platform :ios, '15.0'Default platform and deployment target
target 'Name' do … endAn existing Xcode target; nested targets inherit
spm …A Swift package and the products the target links
binary …A prebuilt SDK, pinned by URL and SHA-256 or taken from the catalog
group :name do … endNamed declarations that targets apply with use :name
include 'shared.podfile'Platform, groups and includes from another file
settings 'KEY' => 'value'Build settings for the target
script_phase name: …, script: …A Run Script phase on the target

Full Podfile reference →

Commands

CommandWhat it does
swiftpods install --resolveIntegrate the Podfile and let Xcode resolve versions
swiftpods install --deploymentFor CI: require the committed locks and never update them
swiftpods install --update-sourcesRefresh catalog metadata and update SwiftPods.lock
swiftpods install --adoptTake over package references added in Xcode
swiftpods checkShow what each target gets, without changing the project
swiftpods search DatadogFind a package in the catalog
swiftpods deintegrateRemove everything SwiftPods added

All commands and options →

What to commit

  • The Podfile, the Xcode project and its Package.resolved, which pins the package graph.
  • SwiftPods.lock, when the Podfile names catalog packages and CI runs deployment mode.
  • Not SwiftPods/: add it to .gitignore. Installation recreates it.