title: Swift Package Manager - Resolve Package Versions terminal command
body: <p>I want to replace cocoapods with SPM. I have decided to go at it one library at a time. I removed the swinject library from cocoapods and added it via <code>File-&gt;Swift Packages-&gt;Add Package Dependency</code></p>
  
  <p>This was successful and the project built and ran as expected.</p>
  
  <p><a href="https://i.stack.imgur.com/yhGl1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/yhGl1.png" alt="enter image description here"></a></p>
  
  <p>I then asked other people in my team to check out the branch and see if they can build the project on their side without issues. We then ran into the error "Missing package product 'Swinject'". We resolved this error by performing <code>File-&gt;Swift Packages-&gt;Resolve Package Versions</code> in Xcode.</p>
  
  <p>I need to get this working on the build server as well. I tried typing in <code>swift package --help</code> in the Terminal app to see what commands are available. The <code>resolve</code> command looked promising so I tried that to no avail. (error: root manifest not found)</p>
  
  <p>So, my question then, is there a terminal command that does the same as <code>File-&gt;Swift Packages-&gt;Resolve Package Versions</code>?</p>
  
  <p>Note: When I added the 3rd party library via SPM, it created one file for me: <code>Proj.xcworkspace/xcshareddata/swiftpm/Package.resolved</code>. It also made various changes to the <code>Proj.xcodeproj/project.pbxproj</code> file. No <code>package.swift</code> file was created.</p>
  
  <p><strong>Update</strong>:
  The closest I have gotten to an answer was that I should try <code>xcodebuild -resolvePackageDependencies</code>, unfortunately the command does not do the same as <code>File-&gt;Swift Packages-&gt;Resolve Package Versions</code>.</p>