Wrote a quick and dirty script for clearing “nonsense” files with a click.

Copy the contents of this script to a file on your Mac.
Save it to a file named, say, cleanup.sh, preferably in your home directory (or the directory where your terminal opens up by default)
Set execute permissions to it by typing,
chmod +x cleanup.sh

You are done.

Whenever Xcode “misbehaves”, just execute this script. It cleans up your Simulator and derived data directory for you.
Updates welcome.


Mugunth

Follow me on Twitter

  • midjar

    Added a suggestion for improvement on your gist.
    Thanks for a great blog.

  • Hi, does it apply to XCode 4.0 and 4.2?

  • NoEmail

    Will break with every new iOS simulator version

  • Isaac Lim

    I did this, but now when I compile, it gives me errors saying “unable to create” the DerivedData directory?