Dan Nissenbaum
Dan Nissenbaum

Reputation: 13928

Xcode: How to clean all projects, rather than just 1 project?

I have an Xcode solution with 5 projects present. ("Solution" is the Visual Studio term for the overall running IDE instance's main area with all of its projects; I am not sure what the Xcode equivalent term is.)

I would like to perform a clean/rebuild on all 5 projects.

Unfortunately, when I select Product -> Clean, Xcode only cleans one of the 5 projects. You can see this in the second screenshot below.

The project that Xcode chooses to clean (out of the 5) is an executable (application). Of the remaining 4 projects that I'd like Xcode to clean as well, 1 is a dynamic library, and 3 are static libraries.

How, using Xcode, am I able to clean every project in the solution, rather than just 1 project?

Here are screenshots of my setup.

(1) Screenshot of the Xcode main screen, showing my 5 projects listed in the left pane.

Xcode5projects

(2) Screenshot of the log, showing my attempt to clean all the projects in the solution via Project -> Clean. The top (most recent) entry is selected in the left pane. In the main pane, you can see that only 1 out of the 5 projects in the solution has actually been cleaned by Xcode.

XcodeOnlyCleans1Project

Thanks!

ADDENDUM

In response to Martin's answer. I have held the Option key while selecting the Project menu, and I do not see a "clean build folder" option. See screenshot.

(3) Screenshot of the Project menu showing, when the Project menu was selected with the Option key held down.

enter image description here

Upvotes: 3

Views: 4127

Answers (2)

Bradford2000
Bradford2000

Reputation: 723

You can clean the build folder by pressing Command+Option+Shift+K. Also, for Martin R's answer, open the Product folder and then press Option. I believe that you have to continue holding option to see the Clean Build Folder option.

Upvotes: 1

Martin R
Martin R

Reputation: 540005

If you hold the option-key while selecting the "Product" menu, you can choose "Clean Build Folder ...". This should delete all generated files from all projects in your workspace.

Upvotes: 5

Related Questions