当前位置:网站首页>xcode 编译速度慢的解决办法
xcode 编译速度慢的解决办法
2022-04-23 06:09:00 【dotphoenix】
最近在开发一个大项目的时候遇到一个很头疼的问题,由于项目代码较多,每次都要编译链接1分钟左右,调试的时候很浪费时间,于是研究了一下如何提高编译链接的速度,在这里分享给大家。
提升编译链接的速度主要有以下三个方式:
1. 提高XCode编译时使用的线程数
defaults write com.apple.Xcode PBXNumberOfParallelBuildSubtasks 4
XCode默认使用与CPU核数相同的线程来进行编译,但由于编译过程中的IO操作往往比CPU运算要多,因此适当的提升线程数可以在一定程度上加快编译速度。本人采用的是4核的CPU,将线程数改为8后编译速度略有提升。
2. 将Debug Information Format改为DWARF
在工程对应Target的Build Settings中,找到Debug Information Format这一项,将Debug时的DWARF with dSYM file改为DWARF。
这一项设置的是是否将调试信息加入到可执行文件中,改为DWARF后,如果程序崩溃,将无法输出崩溃位置对应的函数堆栈,但由于Debug模式下可以在XCode中查看调试信息,所以改为DWARF影响并不大。这一项更改完之后,可以大幅提升编译速度。
3. 将Build Active Architecture Only改为Yes
在工程对应Target的Build Settings中,找到Build Active Architecture Only这一项,将Debug时的No改为Yes。
这一项设置的是是否仅编译当前架构的版本,如果为No,会编译所有架构的版本。需要注意的是,此选项在Release模式下必须为Yes,否则发布的ipa在部分设备上将不能运行。这一项更改完之后,可以显著提高编译速度。
本人在设置完以上三个项之后,编译时间从1分钟左右减少到10秒左右,因此效果还是相当明显的。
版权声明
本文为[dotphoenix]所创,转载请带上原文链接,感谢
https://blog.csdn.net/dotphoenix/article/details/89883534
边栏推荐
- Three methods to realize the rotation of ImageView with its own center as the origin
- 统一任务分发调度执行框架
- org. xml. sax. SAXParseException; lineNumber: 141; columnNumber: 252; cvc-complex-type. 2.4. a: Found element 'B
- Android interview Online Economic encyclopedia [constantly updating...]
- Using queue to realize stack
- Cause: dx.jar is missing
- MySQL5.7插入中文数据,报错:`Incorrect string value: ‘\xB8\xDF\xAE\xF9\x80 at row 1`
- 【2021年新书推荐】Kubernetes in Production Best Practices
- ARGB透明度换算
- Viewpager2 realizes Gallery effect. After notifydatasetchanged, pagetransformer displays abnormal interface deformation
猜你喜欢

Miscellaneous learning

开篇:双指针仪表盘的识别

iTOP4412 HDMI显示(4.0.3_r1)

窗口分析函数LAST_VALUE,FIRST_VALUE,lag,lead

this. getOptions is not a function

ViewPager2实现画廊效果执行notifyDataSetChanged后PageTransformer显示异常 界面变形问题

Cause: dx. jar is missing

C connection of new world Internet of things cloud platform (simple understanding version)

Encapsulate a set of project network request framework from 0

JVM basics you should know
随机推荐
What did you do during the internship
【2021年新书推荐】Artificial Intelligence for IoT Cookbook
[2021 book recommendation] artistic intelligence for IOT Cookbook
[2021 book recommendation] Red Hat Certified Engineer (RHCE) Study Guide
Abnormal record-17
[sm8150] [pixel4] LCD driver
Binder机制原理
Three methods to realize the rotation of ImageView with its own center as the origin
MySQL笔记2_数据表
【2021年新书推荐】Enterprise Application Development with C# 9 and .NET 5
基于BottomNavigationView实现底部导航栏
DCMTK (dcm4che) works together with dicoogle
oracle清除sql的缓存
oracle创建表空间和修改用户默认表空间
取消远程依赖,用本地依赖
MarkDown基础语法笔记
Abnormal record-11
webView因证书问题显示一片空白
Itop4412 HDMI display (4.4.4_r1)
常用UI控件简写名