Skip to content

Is it safe to delete Swift package .build folders?

Build products and dependency checkouts that Swift Package Manager creates next to a package's Package.swift file.

Safe

Its owner recreates it by itself when it needs it, and nothing you made is lost.

~/**/.build

  • Only next to Package.swift
  • Never inside ~/Library

What it is

When you build, test or run a Swift package with the swift command-line tool, Swift Package Manager puts compiled products, intermediate files and copies of the package's dependencies in a .build folder at the package root. It creates the folder again the next time you build, and your source code isn't affected. The folder grows with each configuration and platform you build for.

If it's removed

The next build of each package is a full, slower build, and its dependencies are fetched again. Tools you built and run from the .build folder are removed until you build them again.

How it's removed

Moved to the Trash, where you can restore it.

PRO

The free analyzer finds it and explains it. Removing it is Pro, after a review sheet that lists every move and command. It starts checked in the Cleanup checklist, except inside Documents or Desktop.

Sources

Last checked on 26 Sep 2026. Every entry is written and checked by hand; the app and the command-line tool use the same words.