当前位置:网站首页>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
边栏推荐
- Component based learning (3) path and group annotations in arouter
- oracle计算两日期相差多少秒,分钟,小时,天
- JS 比较2个数组中不同的元素
- Exception record-9
- 接口幂等性问题
- ThreadLocal,看我就够了!
- 【2021年新书推荐】Enterprise Application Development with C# 9 and .NET 5
- 从0开始封装一套项目的网络请求框架
- WebView displays a blank due to a certificate problem
- org. xml. sax. SAXParseException; lineNumber: 141; columnNumber: 252; cvc-complex-type. 2.4. a: Found element 'B
猜你喜欢

Component based learning (1) idea and Implementation

一款png生成webp,gif, apng,同时支持webp,gif, apng转化的工具iSparta

Android清除应用缓存
![Android interview Online Economic encyclopedia [constantly updating...]](/img/48/dd1abec83ec0db7d68812f5fa9dcfc.png)
Android interview Online Economic encyclopedia [constantly updating...]

Component based learning (3) path and group annotations in arouter
![[recommendation for new books in 2021] professional azure SQL managed database administration](/img/f1/b38cce1dc328a5b534011169909127.png)
[recommendation for new books in 2021] professional azure SQL managed database administration

What did you do during the internship

Binder mechanism principle

【2021年新书推荐】Practical IoT Hacking

Bottom navigation bar based on bottomnavigationview
随机推荐
解决:You have 18 unapplied migration(s). Your project may not work properly until you apply
npm ERR code 500解决
Oracle Job定时任务的使用详解
MySQL笔记1_数据库
BottomSheetDialogFragment 与 ListView RecyclerView ScrollView 滑动冲突问题
Itop4412 HDMI display (4.0.3_r1)
基于BottomNavigationView实现底部导航栏
同时解决高度塌陷和外边距重叠问题
谷歌AdMob广告学习
[SM8150][Pixel4]LCD驱动
JS 比较2个数组中不同的元素
Viewpager2 realizes Gallery effect. After notifydatasetchanged, pagetransformer displays abnormal interface deformation
组件化学习
iTOP4412 LCD背光驱动(PWM)
[2021 book recommendation] red hat rhcsa 8 cert Guide: ex200
oracle用delete删除数据所需时间测试
Miscellaneous learning
中国各省会城市经纬度位置
【2021年新书推荐】Enterprise Application Development with C# 9 and .NET 5
Binder mechanism principle