XCode Compilation speed is slow
There are three ways to increase the speed of compiling links:
1. Increase the number of threads used for XCode Compilation
Defaults write com. apple. Xcode PBXNumberOfParallelBuildSubtasks 4
XCode uses the same thread as the number of CPU cores by default for compilation. However, since the number of I/O operations in the compilation process is usually more than that in the CPU, therefore, appropriately increasing the number of threads can speed up compilation to a certain extent.
2. Change the Debug Information Format to DWARF.
In the Build Settings corresponding to the Target of the project, find the Debug Information Format item and change the DWARF with dSYM file in Debug to DWARF.
This item sets whether to add debugging information to the executable file. If the program crashes, the function stack corresponding to the crash location cannot be output, however, in Debug mode, debugging information can be viewed in XCode, so changing to DWARF does not have much impact. After this item is changed, the Compilation speed can be greatly improved.
3. Change Build Active Architecture Only to Yes.
In the Build Settings corresponding to the Target of the project, find the Build Active Architecture Only option and change No in Debug to Yes.
This item sets whether to compile only the version of the current architecture. If it is No, it will compile the versions of all architectures. Note that this option must be Yes in Release mode; otherwise, published ipa will not run on some devices. After this item is changed, the Compilation speed can be significantly improved.
After setting the preceding three items, we believe that the compilation time will be much shorter.