Takes lot of time to Archive in Xcode

I’ve been struggling with the Archive time too since we updated to the 3.x branch. I tried to build the libcocos2dx.a file once and then just link it with the game (it makes no sense to rebuild the whole library each time) but had no luck with that.
Besides removing unnecessary dependencies or upgrading the hardware, are there any other suggestions to improve build times?

I would like to bump this thread, as it seems nothing was concluded after all… It would be great to have some sort of analysis of compilation times and ways to improve it, especially with Xcode.

Well, I recently submitted an app to the app store and on a 11 inch MacBook Air with 4gb of RAM it took just about 11 mins for it to prepare if I recall correctly. I could time this more accurately. I also have a 15 inch MacBook Pro, quad core, 16gb RAM and a 1tb SSD that I could try with as well.

Edit: I wanted to gain a further understanding of what really happens during this phase, so I asked: https://stackoverflow.com/questions/25271640/what-happens-technically-when-you-create-an-ipa-in-xcode and it looks like it is going to get down voted and closed :frowning:

1 Like

@slackmoehrle
How big was the project ?

As i am seeing from all the above post it takes more than 10 mins for any cocos2dx 3.x (including fresh new project !)

I was testing in Xcode 6 , however it was failing to create IPA due to some errors. But it was little bit faster than Xcode 5.x version. Also there was surprise that in Xcode 5.x it was compiling around 900 source files (of Cocos2dx lib) but in Xcode 6 it was compiling 600 files :slight_smile:

Edit

I guess while creating IPA Xcode compiles the code for all the supported architectures , thats why it takes more time . if you connect the device & run it takes less time to compile (even after you clean & build).

Its small, Cocos2d-x plus 10 classes.

lol, the crappy part of SO got to you first. Well, thanks for looking into it. I will take a look as well, to see if there is anything specific causing this slowness from my end through trial and error.

I was told that during Product -> Archive basically the product is built for each architecture you are targeting. Where as when building for the Simulator or with hardware connected it is just getting built for that selection. So Product -> Archive should be taking longer to complete.

1 Like

yes thats correct. But new project of Cocos2dx 2.x branch takes only 1.30 seconds on my system config compared to 12+ min of cocos2d 3.x branch. !

I am going to ask some of the devs to look over this thread and see if we can conclude why v3 takes so much longer. I can’t promise a concrete fix right now since I don’t know the cause.

Archiving after a clean:
1:57 on 2.2.4
14:04 on 3.2

Building after a clean:
1:57 on 2.2.4 (yes, same as archive, double checked)
4:55 on 3.2

Same project, obviously converted from 2.2.4 to 3.2 but nothing new added, actually the 2.2.4 is 4 advert frameworks smaller that I haven’t added to the 3.2 version.

System Specs:
XCode 5.1.1, 2.7 i7, 2 core, Macbook Pro with 16GB, 1TB 5400rpm HDD with 140GB free.

Quite a bit of difference even when just building, I was thinking of investing in an SSD to help.

ADDITION!! I just checked the archive file for both, the 2.2.4 version is 44MB, the 3.2 version is 80.5MB. Hmmm…

You can?! Do you have more info or a link about this?

I heard distributed compile where removed from Xcode 4.5.
http://stackoverflow.com/questions/14865563/distributed-builds-in-xcode-4-5

before Xcode 4.5
http://blog.mundue.net/2010/12/distributed-builds/

oh it was removed but you can still use distcc which is what Xcode used.

https://code.google.com/p/distcc/

I really don’t think that will work… but anyway, off topic.

Back on topic: there is something wrong with cocos2d-x v3 compiling on Mac. To quote my post from above, my build and archive times:

Archiving after a clean:
1:57 on 2.2.4
14:04 on 3.2

Building after a clean:
1:57 on 2.2.4 (yes, same as archive, double checked)
4:55 on 3.2

And the resulting archive file is double the size (80mb compared to 44mb).

Can you tell me what platforms you are targeting when you do this? iPhone, iPad, iPad x64, etc?
From what I was told it has to compile for each so this is 3 times compiling everything. That being said 14:04 is extremely high and we should look into it.

and yes, off topic. but distcc actually works great for me. I’d be happy to write something up about my setup if you have any interest.

@GMTDev
What modules did you have on v2.2.4 and v3.2?

@GMTDev
Did you create a new project to do it? The difference between the two versions is that, content in template changed:

  • v2.2.4: create as simple as possible from template
  • v3.2: create a full codes from template

Because adding a new module seems more difficult for developers than removing a module. But of course, i will checkout it.

I tested in latest codes of github, cpp-empty-test took about less 2 minutes to archive.

Hi guys, could you please tell me how to reproduce the issue step by step?
Thanks.

I think the problem may be we divide engine into different targets, such as, chipmunk is a target, cocos2d is a target, box2d is a target, network is a target and so on, if we link many targets, there will be more linking time. The reason we use target is that, it is easy to add/remove codes.