Skip to content

spm_resolve

Resolve and fetch all Swift Package Manager (SPM) dependencies defined in your Xcode project or Package.swift file. This downloads the exact package versions specified in Package.resolved, ensuring your dependency graph is complete and ready for building. Use this after cloning a repository, switching branches, or when Xcode reports missing packages.

ParameterTypeRequiredDefaultDescription
projectPathstringNoAbsolute path to the .xcodeproj, .xcworkspace, or directory containing Package.swift. If omitted, uses the current working directory.
schemestringNoThe Xcode scheme to resolve dependencies for. Useful when a workspace contains multiple projects with different dependency trees.
clonedSourcePackagesDirstringNoCustom directory to store cloned package sources. Useful for CI caches or shared builds.

“Resolve all Swift packages for my project”

{
"projectPath": "/Users/johndoe/Projects/MyApp/MyApp.xcodeproj"
}

“Resolve SPM dependencies for the MyApp-Dev scheme”

{
"projectPath": "/Users/johndoe/Projects/MyApp/MyApp.xcworkspace",
"scheme": "MyApp-Dev"
}

Resolve with a custom package cache directory

Section titled “Resolve with a custom package cache directory”

“Resolve packages and store them in our CI cache folder”

{
"projectPath": "/Users/johndoe/Projects/MyApp/MyApp.xcodeproj",
"clonedSourcePackagesDir": "/Users/johndoe/Projects/MyApp/.spm-cache"
}

“Resolve dependencies for my Swift package”

{
"projectPath": "/Users/johndoe/Projects/MyLibrary"
}
Resolving Swift Package Manager dependencies...
Project: /Users/johndoe/Projects/MyApp/MyApp.xcodeproj
Fetching https://github.com/Alamofire/Alamofire.git
Fetching https://github.com/SnapKit/SnapKit.git
Fetching https://github.com/onevcat/Kingfisher.git
Fetching https://github.com/apple/swift-collections.git
Resolved 4 packages:
Alamofire 5.9.1
SnapKit 5.7.1
Kingfisher 8.1.0
swift-collections 1.1.4
All packages resolved successfully.