Where is Swift Package Manager cache located (Xcode 12.5)?

There is a question on stackoverflow for that too: https://stackoverflow.com/questions/66143815/xcode-12-5-spm-dependency-cache-location

Xcode 12.5 release notes mention the "per-user-basis" cache for SPM dependencies: https://developer.apple.com/documentation/xcode-release-notes/xcode-12_5-beta-release-notes

Is the location outside of DerivedData folder so cache still persists somewhere in ~/Library/Caches and can be reused even for clean build?

It's very important to know for CI performance!

Any guidance/help is appreciated.

Replies

See ~/Library/Caches/org.swift.swiftpm/.
Post not yet marked as solved Up vote reply of jlc3 Down vote reply of jlc3

For anyone else finding this question, there's also the swift package purge-clean and swift package reset commands.

  • Is there a list of commands/cheatsheet somewhere?

  • The full set of commands can be seen by running: swift package -help

    Also, an update: the command above is outdated. The current syntax is swift package purge-cache (swift tools v5.7)

Add a Comment