1

I have a problem in my Xcode.

Before, my project took 30/45s to compile, but one morning, it began to take 2min / 2min30 to compile and especially during this step : "Running 2 of 3 custom shell scripts"

I don't understand why I don't change anything in the settings, I tried to reinstall Xcode, and on my project I use CocoaPods I tried pod install, pod update, but nothing changes...

If someone know the problem and could help me please, thank in advance..!

CizooDev
  • 81
  • 15

1 Answers1

1

It's likely you have code optimisation switched on, whilst this is a must for building your release version, for dev builds it isn't particularly important.

What code optimisation does is exactly what it says, it optimises your code to make the end binary that is produced smaller. It does things such as rename variables/methods to single characters etc... Like I said you obviously want this when submitting to the app store but you might not care if the app is larger whilst developing it.

You can turn off code optimisation for development builds by going to Project Settings > Build Settings, searching 'optim', under Swift Compiler - Code Generation set Optimization Level to None [-Onone] for Debug builds.

This should significantly improve your build times.

Jacob King
  • 6,025
  • 4
  • 27
  • 45
  • Hi thank for your answer, I checked and I have already this option for Debug Builds :/ – CizooDev Dec 13 '16 at 12:46
  • Ah okay, my only other suggestion is that a pod may be have a long running script. It would be worth checking the build phases for both your project and the pods project for this. – Jacob King Dec 13 '16 at 12:48
  • Yeah but it's so strange because before I don't have this time to compile with the same lib :/ – CizooDev Dec 13 '16 at 12:49
  • And you havent done any other updates in the meantime? El Capitan -> Sierra for example? – Jacob King Dec 13 '16 at 12:53
  • If indeed, I updated my system to Sierra but some days afters updates I don't have this problem.. But I think there was a minor update (10.12 to 10.12.1 I think) during the night, you think it's the reason of my problem ? – CizooDev Dec 13 '16 at 14:28
  • It's hard to say definitively but if it is the only discrepancy between one day and the next (the project compiling quickly or slowly) then I would say it is likely. – Jacob King Dec 13 '16 at 14:29
  • I tried at the moment with a friend who have the same system version and with the same project and he compile normally.. I don't understand why I take time now to compile... – CizooDev Dec 13 '16 at 14:58
  • 1
    It might be worth your while to run this: [Build Time Analyser](https://github.com/RobertGummesson/BuildTimeAnalyzer-for-Xcode), has proven useful for me in the past. – Jacob King Dec 13 '16 at 15:37
  • Finally, I follow this instruction : http://stackoverflow.com/questions/40531545/running-1-of-2-custom-shell-script-stuck-for-2-minutes-in-xcode I don't know if this has a real effect on the code but I gain some compilation time – CizooDev Dec 13 '16 at 16:03