Apple recommends committing the Package.resolved file created by Xcode for an app. Package requirements specify allowed versions. The resolved file records the revisions and binary checksums actually selected.
Make upgrades reviewable
Review the resolved-file diff with the code change. In a fresh checkout, open the workspace used by CI and run the relevant tests. If versions drift, check that CI uses that file and does not explicitly update dependencies.
Verify a clean checkout and a deliberate upgrade
For an Xcode app, locate the resolved file under the project or workspace that the team actually opens. Confirm Git tracks it and that an ignore rule does not hide it. Then compare its recorded revisions with the dependencies shown by Xcode. Keep the project’s allowed version requirements under review as well.
Suppose your laptop has a recent package version but the cloud build cannot resolve the same graph. Check the failing commit for the resolved file before deleting caches. An uncommitted local change may explain why the two machines build different dependencies. A private repository access failure calls for checking access separately, even when the file is present.
Use a fresh checkout of the same commit to verify the graph is available to another developer or CI. Record the selected package revisions and run the tests that exercise those packages. When deliberately upgrading, let Xcode resolve the new versions, inspect the resulting diff and commit the resolved change with the intended upgrade.
For example, a networking package upgrade should include a test for one successful request and one expected error response that your app handles. After merging, verify CI uses the intended revision. Retaining a previous commit gives you a clear rollback point if the upgrade changes behavior.
https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app