Swift Package Manager
By Swift Package Manager · swift.org
- Free plan
- Windows
- macOS
- Linux
- iPhone and iPad
What Swift Package Manager is
Swift Package Manager is a free tool for sharing Swift code, using dependencies, and building, testing, documenting, and running projects. A package is organized around a `Package.swift` manifest with source files, resources, and other assets. It can provide library, executable, or plugin products, and depend on Swift packages, system libraries, or binary dependencies. Commands such as `swift build` and `swift test` support development; dependencies are resolved automatically when `swift build` or `swift run` is invoked. Plugins can add build capabilities or package commands, including generating files and resources, and run in a sandbox that blocks network and most file access unless users approve added permissions. SwiftPM works on the command line and is integrated into Xcode. It supports macOS, Linux distributions including Ubuntu, Debian, Fedora, and Amazon Linux, plus Windows; tools on macOS can build for Apple platforms including iOS. Swift 6.4 made Swift Build the default build system in Swift Package Manager.
Who it suits
Swift Package Manager suits developers managing Swift dependencies or sharing packages for personal, private company, or open-source use. It also supports teams building, testing, and documenting Swift projects.
Good to know, and what to watch
- Free package management tool.
- Resolves dependencies during build or run commands.
- Works from command line and within Xcode.
- Plugin sandbox restricts network and file access.
- Plugins may need user-approved additional permissions.
- Apple platform builds require tools on macOS.
Plans
Every plan and priceSwift Package Manager
Free plan
Getting started
- Open the Swift Package Manager documentation
- Use a supported macOS, Linux, or Windows development environment
- Create a package with a Package.swift manifest and source files
- Declare products, targets, and dependencies
- Run swift build or swift run to resolve packages automatically
- Run swift test to build and test the package
- Use command-line SwiftPM or its Xcode integration
The verdict
Swift Package Manager covers package sharing, dependency resolution, builds, tests, and plugins across its listed development platforms. Its Xcode integration and command-line workflow make it relevant to both individual package work and team projects.
Questions people ask
Does Swift Package Manager cost anything?
No. It is listed as free, with a free free plan.
Which operating systems are supported?
Swift Package Manager supports macOS, Linux distributions including Ubuntu and Debian, and Windows. macOS tools can build for Apple platforms such as iOS.
What package types can it handle?
It supports source packages, system libraries, binary targets, and package registry archives.
Can it generate API documentation?
Yes. Inputs can include Symbol Graph JSON files, DocC documentation catalogs, and Markdown. Output can be a machine-readable JSON archive or static HTML website.
How are package plugins secured?
Plugins run in a sandbox blocking network and most filesystem access unless the user approves additional permissions.
Is SwiftPM integrated with Xcode?
Yes. It works from the command line and is integrated within Xcode.
What the maker publishes
- Apple deployment targets
- Swift tools on macOS can build applications for Apple platforms including iOS. source
- Build and test
- SwiftPM includes commands such as swift build and swift test, and automatically resolves packages when swift build or swift run is invoked. source
- Current build system
- Swift 6.4 made Swift Build the default build system in Swift Package Manager. source
- Dependencies
- A package can depend on other Swift packages, system libraries, or binary dependencies. source
- Dependency resolution
- Yes source
- Founded
- 2021 source
- Founded
- 2015 source
- Free plan
- Yes source
- License
- Swift and its package manager were published under the Apache 2.0 license with a Runtime Library Exception. source
- Lockfile support
- Yes source
- Offline installation
- Yes source
- Package formats
- source packages,system libraries,binary targets,package registry archives source
- Package structure
- A package consists of a Package.swift manifest and source files, resources, and other assets. source
- Plugins
- Plugins can add build capabilities or package commands, including generating source files and resources as part of a build. source
- Plugin security
- Plugins run in a sandbox that blocks network access and most file system access unless additional permissions are approved by the user. source
- Private registry auth
- Yes source
- Products and targets
- Packages can provide library, executable, and plugin products built from targets. source
- Purpose
- Swift Package Manager lets developers share code as packages, use other shared packages, and build, test, document, and run code. source
- Supported development platforms
- Swift Package Manager is supported on macOS, Ubuntu, Debian, Fedora, Amazon Linux, Red Hat Universal Base Image, and Windows. source
- Supported platforms
- macOS,Linux,Windows; packages can target Apple platforms source
- Who it is for
- Swift packages can be created for personal use, private company use, or release as open-source packages for the community. source
- Xcode integration
- SwiftPM works from the command line and is integrated within Xcode. source
Checked against the maker's pages on 7 Oct 2026.