Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 4 "Clean" vs. "Clean Build Folder"

You come at a certain point in the development of every app that what you see in the simulator does not match what you think should happen. Mostly these are human errors -- or at least they are in most of my cases ;-) -- but sometimes Xcode has just 'lost track', or so it seems. I've learnt that the Clean (Shift+Cmd+K) and Clean Build Folder… (Option+Shift+Command+K) menu options can show the difference between your error or Xcode's.

My question though is:

What does the Clean command do or not do, which leaves a reason for Clean Build Folder… to exist? When should I pick one over the other, why not just always clean the whole folder?

like image 696
epologee Avatar asked Nov 10 '11 22:11

epologee


People also ask

What is clean build folder Xcode?

Clean the Build Folder This will delete all of the products and intermediate files in the build folder. To clean the build folder you can use the shortcut Command+Option+Shift+K or Menu Bar → Product → Hold Option Key → Clean build Folder .

What does cleaning the build folder do?

If you select Clean from the Product menu, XCode will delete the files inside every folder in the Build folder, if you select Clean Build Folder it will delete the entire Build folder.

What does clean do in Xcode?

"clean: Removes all the product files, as well as any object files (.o files) or other intermediate files created during the build process."


2 Answers

If you select Clean from the Product menu, XCode will delete the files inside every folder in the Build folder, if you select Clean Build Folder it will delete the entire Build folder.

After Clean command:

enter image description here After Clean Build Folder command:

enter image description here

I think you should select Clean Build Folder when you want to build a binary that you want to release to the AppStore, when you messed up with your project or when your app doesn't work for an "unknown" reason, otherwise use Clean.

I hope I've answered your question :D

like image 83
Aluminum Avatar answered Oct 13 '22 06:10

Aluminum


Clean… cleans the folders for the current selected target.
Clean Build Folder… cleans the folders for all the targets.

like image 44
Oliver Avatar answered Oct 13 '22 04:10

Oliver