Sh*t my brain says and forgets about

Xcode SCM & build directory

Xcode has a build directory inside of your project, which you shouldn’t be including in your source code management repository.  Simply said, those files change so much and are “discardable”.  There is no way to easily exclude this directory from your repository.  The accepted way to fix this (after some digging) is to simply move the build directory for Xcode to a temporary folder.

To move the build directory, click on the Xcode menu in your menu bar, and click on Preferences.  Change the folder under “Building” to a temporary folder.  I created a tmp directory in my user folder.

Xcode Preferences Build

Previous

Stealing Music

Next

Software Project Management Plan Template

4 Comments

  1. marco

    gracias

  2. chris

    Setting svn:ignore is also possible, and doesn’t require a change of the project structure. I guess having the build files in the designated folder makes it not only easy to debug the build objects, but also keeps things tidy.

    Have a look at svn properties for instance. Other SCMs have similar techniques.

  3. Astralbodies

    Chris – later projects I did use the svn:ignore, especially when multiple developers were working on the same project. Xcode 4 puts build assets in a separate folder by default now – probably to better support SCM on the command line or possibly to just conform to the idea of Application Caches and disposable files being in ~/Library (specifically ~/Library/Developer/Xcode/DerivedData).

  4. Peter Hornby

    @AstralBodies : thanks for the tip about XCode 4, by default, maintaining build assets (and other things) in a location other than the project folder. I’m just starting out on Mac development, and trying to find the executable file that XCode had just built (and run) for me was driving me nuts. Specifically, I needed, for the purposes of my example, to copy two .bundle files to the folder where my command-line executable lived. Couldn’t find the .bundle files, nor the command-line executable. Spotlight didn’t help. The XCode preference “Place build products in locations specified by targets”, in the Locations tab, solved the problem for me.

Leave a Reply

Your email address will not be published. Required fields are marked *

Powered by WordPress & Theme by Anders Norén