We have a tool in our CI which periodically updates our iOS project's Swift Package Manager dependencies. The script that does a few things, but generally speaking it
first removes the existing package.resolved
at
./ProjectName.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
and then runs:
xcodebuild -resolvePackageDependencies -disablePackageRepositoryCache
This regenerated the package.resolved
file to reflect the latest, updated versions of the dependencies. It is the equivalent of doing Xcode > File > Packages> Update to Latest Package Versions
.
This has been working perfectly for a long time, but has stopped working since we moved from Xcode 15.4 to Xcode 16. I have also tested this with Xcode 16.1 and 16.2 - with no luck.
I have tried running this command locally, and can confirm it is not an issue with the environment of our CI. I have also tried swift package update
.
Both of these commands appear to work - no errors are thrown, and the logs say "resolved source packages". However, they are not updating the packages. They are making no changes to the package.resolved
file.
However, using Xcode > File > Packages> Update to Latest Package Versions
in Xcode 16 works as expected - the packages are updated and the .resolved
file is updated.
Is there now a different way to update Swift packages via the command line, or is this likely an Xcode 16 bug?
Update: This feels broken, so I have submitted a Feedback Report (FB16108036) but perhaps someone can suggest a workaround for the time being!