Improving build time on XCode 4.5 for a huge game project Improving build time on XCode 4.5 for a huge game project xcode xcode

Improving build time on XCode 4.5 for a huge game project


What you are looking for is improving your compile and launch time for debug, right? So what about creating a different target for every platform? So you keep the same code but only package a subset of resources for debug purpose depending on your debug device.

To do this, go on your actual target, right click and duplicate. Keep your actual target untouched, it's the fat one! For the new target, let's say it's iPad retina, go to "build phases" -> "copy bundle resources" and remove all the resources which are not related to iPad Retina. Do the same for every platform.

Then on top left of Xcode, select the good target for the specific device. Maybe, you can define which device is accepted for a target.

If you use continuous integration, let your build machine compile the fat target at night.


It is not possible to solve a problem if the cause for the problem is unknown. "My car does not start any longer, is there a way to make it start again?"; most likely, but only if the reason why it currently refuses start is known. It sounds a bit like you hope that there is a magic switch in Xcode named "Build fast" and by enabling it, everything becomes much faster. If there was such a switch, don't you think it would be enabled by default? Don't you think it would actually always be enabled?

I also wonder why you tagged this question with "compiler" and "compiler-optimization". According to your own statement, compiling takes only one minute out of 8.3 minutes build time, so how would further reducing compile time make the overall process much faster? Even if compile time was cut down to zero, this would still leave you with 7.3 minutes build time. Don't optimize at the wrong end.

It's like optimizing code. If your code is too slow, all optimizations are pointless if you don't where in your code most of your time is spent. Optimizing a piece of code to run ten times faster will do nothing for overall performance if only 0.1% of all time is spent in that piece of code. The first step of code optimization is profiling code and finding out how much time is spent at what piece of code.

So to make your build process faster, the first and most important step is finding out why exactly the build times are slow right now. Without that knowledge, all answers people could give here are just guessing into the blue. Once you know exactly where the problem is, you can come back and ask precisely how to make this one step faster. You start by optimizing the slowest step, then the second slowest, and so on.

Take a look at the build log in Xcode

enter image description here

Make sure to select "All Messages", otherwise you will only see warnings and errors, or only errors. Now start a clean build, select the new log that pops up to the left and keep monitoring this log. You will exactly see when Xcode is starting an operation and when it approaches to the next operation. That should give you a first impression which of the tasks take rather long to complete. And once you told us which tasks those are, we can start making suggestion how you might possibly be able to make this task somewhat faster.