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/swiftpodsAdd 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 --deploymentWraps 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
Place a
Podfilenext 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 endMyAppTestsis nested, so it also links whatMyAppdeclares.3f1c…stands for the archive's complete SHA-256.Check what each target gets before changing the project.
swiftpods checkInstall, then open the
.xcodeprojas usual and build.swiftpods install --resolveEach target gets its Swift package products, a generated binary container product, a settings file and the
[SwiftPods] Prepareand[SwiftPods] Finishphases.--resolveasks Xcode to resolve versions intoPackage.resolved.
The Podfile at a glance
| Statement | What it declares |
|---|---|
platform :ios, '15.0' | Default platform and deployment target |
target 'Name' do … end | An 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 … end | Named 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 |
Commands
| Command | What it does |
|---|---|
swiftpods install --resolve | Integrate the Podfile and let Xcode resolve versions |
swiftpods install --deployment | For CI: require the committed locks and never update them |
swiftpods install --update-sources | Refresh catalog metadata and update SwiftPods.lock |
swiftpods install --adopt | Take over package references added in Xcode |
swiftpods check | Show what each target gets, without changing the project |
swiftpods search Datadog | Find a package in the catalog |
swiftpods deintegrate | Remove everything SwiftPods added |
What to commit
- The
Podfile, the Xcode project and itsPackage.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.