Clean Build Folder vs DerivedData removal for stale incremental artifacts
0 reputation · 19 Mar 2020, 20:06 UTC
Choosing between Clean Build Folder and full DerivedData removal is a recurring decision when incremental builds appear to retain outdated artifacts.
Xcode stores build products, indexes and module caches under DerivedData. Clean Build Folder is documented as targeting the project's build products for the active scheme, while deleting DerivedData removes caches for all projects. The exact cache layers affected by each approach is version-sensitive, and it is unclear whether Clean Build Folder clears Clang or Swift module caches and index data, or whether DerivedData removal is scoped to a single project.
Which cache sublayers are cleared by Clean Build Folder in the installed Xcode version? Does full DerivedData removal affect only the selected project or all projects in ~/Library/Developer/Xcode/DerivedData? Under what documented conditions does each approach clear module and index caches?