When creating a game you are usually working with a lot of resources and often you’ll be using dummy resources until the illustrator or the sound guy finishes his assets. This is fine, but as time goes you might end up with a project full of unused crap that only takes up precious space in your final product.
Before we submitted our latest game, Soft Freak Fiesta, I went through the project and removed everything that wasn’t used anywhere in the game. I was able to reduce the size of the game from 27 MiB down to 16 MiB. As you can imagine this is not the most fun task to do not mentioning that you’ll be scared to death that you’re removing something that you really shouldn’t.
So as a lazy programmer I wrote a Ruby script that scans an Xcode project and tries to find those unused files.
The script is very basic and by no means something you should rely on but it should give you some pointers. Keep in mind that it does not scan your Nib/Xib files so if you’re using UIKit/AppKit it will output false positives for files that are only referenced from your nibs.
To use it you point it at your project file and it should spit out a list of all files that are included in the project but not referenced from any source file. At the moment it looks for wav, png, pvr and caf files and searches h, m, c and cpp source files but you can of course customize that.
If you improve it (e.g. to scan nibs as well) I’d love to hear about it.
Get it here.