Takes lot of time to Archive in Xcode

Hello

We are using cocos2dx Version 3.1.1 .
When we try to create a IPA , it takes huge amount of time almost 10 mins to 15 mins . It compiles all the libraries like box2d chipmunk(although our project doesn’t use it), cocos dension & finally after around 8 mins it starts compiling our source files.
Is there any way to speed up the process ?

Thanks.

Well, one thing I can say is if you change any PCH they you force a complete recompile. I don’t see mine forcing a recompile of everything often, but once in a while for sure. If I change a lot surely it takes longer.

I don’t see 10-15 minutes on my end, I’m down around 3-4 mins but I have a lot of RAM and an SSD. Before the SSD I was not a lot slower, 5 mins maybe.

If you have multiple Macs with Xcode you can turn on distributed compile in the Preferences,

1 Like

Thanks for your response.
I am using iMac 2.5Ghz i5 with 4gb of ram & Xcode version is 5.1.1.

When we were using cocos2dx 2.2.3 creating IPA was fast, it used to take around 3 to 4 mins max (For a huge project).
Now in cocos2d 3.1.1 after cleaning the project it takes lot of time to compile all the libraries. Once it compiles next time it won’t take that much time to run it again. But while creating IPA (Adhoc build) it takes hugeee time (because Xcode clean the build & start compiling everything in this process) . Let me know if anyone is facing this issue.

Thanks

Can you tell me the steps you are taking to create the IPA?

Well its normal process .
Select iOS Device , Then click Product ->Archive

ok, just being sure. Let me test out on my end and see how long it takes me

Okay sure Thanks :smile:

Anyone have the same issue ?

It’s normal. There are a lot of classes to compile. If you don’t use box2d or chipmunk library, you can remove them in setting. One more thing is you can disable some un-necessary compile option in cocos2d-libs project.

Thanks for your response. Removing box2d & chipmunk did save couple of minutes.
But i do understand cocos2d has lot of files to compile , but in earlier versions (for ex 2.2.3) it was fast (max 4 to 5 mins compared now almost 15 mins).

Has anything changed in your hardware setup? Is all your RAM showing up? When is the last time you checked for bad sectors? Just thinking of things as 15 mins is really long. I don’t even see that on a stock MacBook Air with only 4gb.

Check that you did not mistakenly change the Optimization level, I had a relatively small project that used to take <2 minutes to build that suddenly started taking 10+ minutes. Changing the Optimization level fixed the issue.

which settings are you referring to?

Apple LLVM Code Generation

  • Optimization Level
1 Like

Thats actually a really good point. The defaults are:

1 Like

Thanks for the input.
But as per the document s is the correct option ?
https://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/Xcode_Build_Setting_Reference.pdf

s: Binary is optimized to fastest and smallest .

Yeah, that does seem to be the correct setting.

Thanks :smiley: :smiley: It’s very helpful.

Just to update everyone.
On my machine 2.5 GHz Core i5 , 4GB ram.
New project created with cocos2dx 2.2.3 takes 1 min 30 seconds to archive.
But Cocos2dx 3.1.1 takes 13 minutes to create a Adhoc build (after removing box2d & chipmunk).
Am downloading Xcode 6 to see if there is any improvements.

Thanks for testing this out. Can you keep me comprised of your results?