Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is package.resolved stored?

Problem

  • I am using Swift Package in my project
  • I can't find package.resolved in the following path: [appName].xcodeproj/project.xcworkspace/xcshareddata/ (even tried showing the hidden files)

My findings:

  • Following path exists but is empty: [appName].xcodeproj/project.xcworkspace/xcshareddata/swiftpm doesn't contain .resolved file
  • [appName].xcodeproj/project.xcworkspace/xcshareddata/swiftpm/configuration is empty

Environment

  • macOS 13.0.1 (22A400)
  • Xcode Version 14.1 (14B47b)

Background

I wanted to check if package.resolved was checked it into git, but now I don't know where to find it.

Questions:

  • Where can I find Package.resolved file?
  • Or has this been changed to a different filename?
like image 453
user1046037 Avatar asked Oct 20 '25 11:10

user1046037


1 Answers

Location of Package.resolved is explained in the Swift Package Manager documentation on Package Dependency:

The Swift Package Manager performs a process called dependency resolution to figure out the exact version of the package dependencies that an app or other Swift package can use. The Package.resolved file records the results of the dependency resolution and lives in the top-level directory of a Swift package. If you add the Swift package as a package dependency to an app for an Apple platform, you can find the Package.resolved file inside your .xcodeproj or .xcworkspace.

Sure enough, right clicking on the .xcodeproj or .xcworkspace file, selecting "Show Package Contents", then exploring shows the Package.resolved file located in:

MyApp.xcworkspace/xcshareddata/swiftpm/Package.resolved

enter image description here

A non-existent Package.resolved may be because Xcode has yet to complete the dependency resolution process for the project or workspace.

like image 181
Max MacLeod Avatar answered Oct 23 '25 00:10

Max MacLeod