如何减少构建时间/加快编译时间在XCode? [英] How to decrease build times / speed up compile time in XCode?

查看:522
本文介绍了如何减少构建时间/加快编译时间在XCode?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常可以使用哪些策略来缩短任何XCode项目的构建时间?我最感兴趣的是XCode的具体策略。



我使用XCode进行iPhone开发,我的项目越来越大。我发现编译/链接阶段开始花费更多的时间比我想要的。



目前,我是:




  • 使用静态库使它成为
    我的大多数代码不需要
    编译每次我清理和构建
    我的主要项目


  • 从我的
    应用程序中删除了大部分资源,并用iPhone中的
    编码文件系统路径b $ b模拟器,所以我的
    资源不必一直是
    打包,因为我对它们进行了更改。




我注意到检查依赖关系阶段似乎需要比我想要的更长。

解决方案

通常,你可以做的最大的事是控制你的包含



在源代码中包含额外头文件会大大减慢编译速度。这也会增加依赖性检查所需的时间。



此外,使用前进声明,而不是包含其他头的头可以大大减少依赖的数量,并帮助您的所有时间。


What strategies can be used in general to decrease build times for any XCode project? I'm mostly interested in XCode specific strategies.

I'm doing iPhone development using XCode, and my project is slowly getting bigger and bigger. I find the compile / link phases are starting to take more time than I'd like.

Currently, I'm:

  • Using Static Libraries to make it so most of my code doesn't need to be compiled everytime I clean and build my main project

  • Have removed most resources from my application, and test with a hard coded file system path in the iPhone simulator whenever possible so my resources don't have to constantly be packaged as I make changes to them.

I've noticed that the "Checking Dependencies" phase seems to take longer than I'd like. Any tips to decrease that as well would be appreciated!

解决方案

Often, the largest thing you can do is to control your inclusion of header files.

Including "extra" header files in source code dramatically slows down the compilation. This also tends to increase the time required for dependency checking.

Also, using forward declaration instead of having headers include other headers can dramatically reduce the number of dependencies, and help all of your timings.

这篇关于如何减少构建时间/加快编译时间在XCode?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆