Developers · Swift package build folders (.build)

Is it safe to delete the .build folder in a Swift package?

Safe to removeComes back on its ownTypical size: 100 MB–10 GB per project
…/.build

Anywhere in your projects: a “.build” folder next to “Package.swift”.

Updated October 17, 2026By the MoreRoom team, Yando Pte. Ltd.This page as Markdown

The short answer

Yes. Rebuilt or re-downloaded automatically when needed.

What is it?

When you build a Swift package from Terminal or an editor such as VS Code, Swift Package Manager puts compiled products, dependency checkouts and caches in a .build folder next to Package.swift. Xcode uses DerivedData instead. Only folders in projects untouched for 30 days are considered.

What happens if you delete it?

The next swift build or swift test fetches dependencies again from Package.resolved and recompiles, which can take several minutes.

How to remove it properly

Run swift package clean to delete build products, or swift package reset to remove the whole .build folder including checkouts; both are permanent. You can also move .build to the Trash in Finder.

Quit the app that uses it, then move it to the Trash. Empty the Trash when you’re sure.

  • MoreRoom only suggests items unused for 30 days or more.

How MoreRoom helps

MoreRoom recognises this item, shows its real size and when it was last used, and labels it “Safe to remove”. In the free version you can move it to the Trash in one click, with Undo; Pro collects every safe item at once.

Frequently asked questions

Is it safe to delete the .build folder in a Swift package?

Yes. Rebuilt or re-downloaded automatically when needed. The next swift build or swift test fetches dependencies again from Package.resolved and recompiles, which can take several minutes.

Will Swift package build folders (.build) come back after I delete it?

Yes. The next swift build or swift test fetches dependencies again from Package.resolved and recompiles, which can take several minutes.

How do I remove Swift package build folders (.build) properly?

Run swift package clean to delete build products, or swift package reset to remove the whole .build folder including checkouts; both are permanent. You can also move .build to the Trash in Finder.

Guides that mention it

Related folders