spm_update
Update all Swift Package Manager dependencies in your project to the latest versions that satisfy the version requirements defined in your Package.swift or Xcode project settings. This modifies Package.resolved with the new version pins. Use this to pick up bug fixes, security patches, and new features from your dependencies.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
projectPath | string | No | — | Absolute path to the .xcodeproj, .xcworkspace, or directory containing Package.swift. If omitted, uses the current working directory. |
Usage Examples
Section titled “Usage Examples”Update all SPM packages
Section titled “Update all SPM packages”“Update all Swift packages to their latest compatible versions”
{ "projectPath": "/Users/johndoe/Projects/MyApp/MyApp.xcodeproj"}Update packages in a Swift library
Section titled “Update packages in a Swift library”“Update dependencies for my Swift package”
{ "projectPath": "/Users/johndoe/Projects/MyLibrary"}Update packages in a workspace
Section titled “Update packages in a workspace”“Update all SPM dependencies in my workspace”
{ "projectPath": "/Users/johndoe/Projects/MyApp/MyApp.xcworkspace"}Example Output
Section titled “Example Output”Updating Swift Package Manager dependencies...Project: /Users/johndoe/Projects/MyApp/MyApp.xcodeproj
Updating https://github.com/Alamofire/Alamofire.gitUpdating https://github.com/SnapKit/SnapKit.gitUpdating https://github.com/onevcat/Kingfisher.gitUpdating https://github.com/apple/swift-collections.git
Updated packages: Alamofire: 5.9.0 -> 5.9.1 Kingfisher: 8.0.3 -> 8.1.0
Unchanged packages: SnapKit: 5.7.1 (already up to date) swift-collections: 1.1.4 (already up to date)
Package.resolved has been updated.Related Tools
Section titled “Related Tools”spm_resolve— Resolve packages to the exact pinned versions without updatingspm_show_dependencies— View the dependency tree after updatingbuild_app— Build the project to verify compatibility after updating