当前位置:网站首页>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
边栏推荐
- 数据库的事务
- 实习做了啥
- Abnormal record-22
- Exception record-14
- Markdown basic grammar notes
- 解决:You have 18 unapplied migration(s). Your project may not work properly until you apply
- adb shell常用模拟按键keycode
- Explore how @ modelandview can forward data and pages through the source code
- Android room database quick start
- Project, how to package
猜你喜欢

谷歌AdMob广告学习

useReducer基本用法

AVD Pixel_ 2_ API_ 24 is already running. If that is not the case, delete the files at C:\Users\admi

ThreadLocal,看我就够了!

./gradlew: Permission denied
![[2021 book recommendation] artistic intelligence for IOT Cookbook](/img/8a/3ff45a911becb895e6dd9e061ac252.png)
[2021 book recommendation] artistic intelligence for IOT Cookbook

从0开始封装一套项目的网络请求框架

【2021年新书推荐】Kubernetes in Production Best Practices

WebView displays a blank due to a certificate problem

统一任务分发调度执行框架
随机推荐
oracle清除sql的缓存
通过rownum来进行区间查询
Component learning (2) arouter principle learning
Itop4412 surfaceflinger (4.4.4_r1)
Abnormal record-13
JVM basics you should know
Recyclerview 批量更新View:notifyItemRangeInserted、notifyItemRangeRemoved、notifyItemRangeChanged
Explore how @ modelandview can forward data and pages through the source code
Tiny4412 HDMI display
launcher隐藏不需要显示的app icon
Miscellaneous learning
Tiny4412 HDMI显示
Bottom navigation bar based on bottomnavigationview
MySQL notes 3_ Restraint_ Primary key constraint
oracle计算两日期相差多少秒,分钟,小时,天
Abnormal record-11
oracle数据库将多个列的查询结果集合并到一行中
sys.dbms_scheduler.create_job创建定时任务(功能更强大丰富)
ARGB透明度换算
Oracle锁表查询和解锁方法