Xcode Build Settings

Architectures

picture1

Additional SDKs

在编译的时候须要附加的SDK。ios

Architectures

支持的处理器架构。支持的指令集越多,就会编译出包含多个指令集代码的数据包,对应生成二进制包就越大,最终目标文件也会变大。swift

指令集能够参考:http://www.jianshu.com/p/3fce0bd6f045缓存

Base SDK

App所能支持的最大iOS版本。Xcode默认会设置为可以支持的最新版本。架构

Build Acitve Architecture Only

若是此项为YES,则Xcode会根据当前所链接设备的版本只将相应的Architecture编译入app。不然会同时编译“Valid Architectures”中的指令集。app

建议在Debug模式下设置为YES,Release模式下设置为NO,加快编译速度。框架

Supported Platform

app支持的平台。目前可选的有iOS、macOS、tvOS、watchOS。iphone

Valid Architectures

限制可能被支持的指令集的范围,也就是Xcode编译出来的二进制包类型最终从这些类型产生,而编译出哪一种指令集的包,将由Architectures与Valid Architectures(所以这个不能为空)的交集来肯定。工具

知识延伸:lipo

lipo源于mac系统要制做兼容powerpc平台和intel平台的程序。测试

lipo 是一个在 Mac OS X 中处理通用程序(Universal Binaries)的工具。fetch

用途一:查看二进制所支持的指令集

picture2

用途二:合并指令集

lipo –create Release-iphoneos/libiphone.a Debig-iphonesimulator/libiphone.a –output libiphone.a

用途三:拆分指令集

lipo SDK.a -thin armv7 -output */SDK.a

Assets

picture3

Asset Pack Manifest URL Prefix

资源包清单的下载路径URL前缀

Embed Asset Packs In Product Bundle

是否将资源包嵌入产品的bundle中

Enable On Demand Resources

是否开启按需获取资源功能

On Demand Resources Initial Install Tags

按需加载资源时的初始安装资源文件标签

On Demand Resources Prefetch Order

按需加载资源时预加载的标签顺序

picture4

picture5

Build Locations

buildLocations-01

Build Products Paths

产品文件和编译中间文件的根目录。产品文件和编译时临时文件都将放在这个目录的子目录中。

Intermediate Build Files Path

编译时临时文件的存放位置。编译中间文件格式为product name+.build,如MyProduct.build。

Per-configuration Build Products Path

当前编译设置下的产品存放位置。

Per-configuration Intermediate Build Files Path

当前编译设置下编译时临时文件的存放位置。

Precompiled Headers Cache Path

预编译头文件缓存存放路径。经过这个配置,Targets能够互相共享预编译的头文件。

这个在Xcode中的设置在File->Project Setting界面进行设置,

BuildLocation-02

BuildLocatios-03

Build Options

Build Option-01

Always Embed Swift Standard Libraries

始终嵌入swift标准库。对于未使用swift代码的状况能够设置为NO。

Build Variants

此项能够设定生成产品的变种。您能够建立额外的产品变种做为特殊用途。例如,您可使用编译配置文件的名称来建立一个高度定制的二进制文件。

Build Variants的值有三个:

normal-用于生成普通的二进制文件;

profile-用于能够生成配置信息的二进制文件;

debug-用于生成带有debug标志、额外断言和诊断代码的二进制文件。

Compiler For C/C++/Objective-C

选择使用的编译器。目前Xcode8.2默认使用APPLE LLVM 8.0版本的编译器。

Debug Information Format

记录debug信息的文件格式。共有DWARF with dSYM File和DWARF两种能够选择。建议选择DWARF with dSYM File。DWARF是较老的文件格式,会在编译时将debug信息写在执行文件中。

Enable BitCode

Bitcode is an intermediate representation of a compiled program. Apps you upload to iTunes Connect that contain bitcode will be compiled and linked on the App Store. Including bitcode will allow Apple to re-optimize your app binary in the future without the need to submit a new version of your app to the store.

Bitcode. When you archive for submission to the App Store, Xcode will compile your app into an intermediate representation. The App Store will then compile the bitcode down into the 64 or 32 bit executables as necessary.

说的是bitcode是被编译程序的一种中间形式的代码。包含bitcode配置的程序将会在App store上被编译和连接。bitcode容许苹果在后期从新优化咱们程序的二进制文件,而不须要咱们从新提交一个新的版本到App store上。

当咱们提交程序到App store上时,Xcode会将程序编译为一个中间表现形式(bitcode)。而后App store会再将这个botcode编译为可执行的64位或32位程序。

不过,咱们如今须要考虑的是三个平台:iOS,Mac OS,watchOS。

对应iOS,bitcode是可选的。

对于watchOS,bitcode是必须的。

Mac OS不支持bitcode。

Enable Testability

是否支持测试。默认选NO;

Generate Profiling Code

是否生成配置代码。默认选择NO。

Precompiled Header Uses Files From Build Directory

预编译build路径中的头文件。因为编译过程比较耗时,且两次编译之间未必会改动全部文件。所以将不会改动的经常使用文件保留成预编译文件将大大减小编译时的时间。建议这一项选择YES。

Require Only App-Extension-Safe API

若是咱们要想应用扩展使用内嵌框架,那么首先要配置一下。将target的Require Only App-Extension-Safe API选项设置为Yes。若是你不这样设置,那么Xcode会向你提示警告:linking against dylib not safe for use in application extensions。

Scan All Source Files for Includes

扫描include文件所包含的全部源文件。

Validate Built Product

这个选项决定了是否在编译的时候进行验证。验证的内容和app store的审查内容一致。默认选项是debug时不验证,release时验证。

Deployment

Headers

Kernel Module

Linking

Search Paths

search path-01

Always Search User Path

是否搜索用户指定的路径,默认是NO;

Framework Search Paths

工程引用的framework搜索路径

Header Search Paths

工程中引用的头文件搜索路径

Library Search Paths

library搜索路径,好比静态.a库

Rez Search Paths

This is a list of paths to search for files included by CarbonResource Manager resources and compiled with the Rez tool.

Sub-Directories to Exclude in Recursive Searches

指定哪些类型的子目录在递归查找时忽略

Sub-Directories to include in Recursive Searches

指定哪些类型的子目录在递归查找时包含

Use Header Maps

User Header Search Paths

设置头文件搜索路径,这个只有当Always Search User Path开启后才有效。

signing

sign-01

Code Signing Entitlements

受权机制。在Xcode的capabilities选项卡下选择一些选项后,Xcode就会生成这样一段XML,Xcode会自动生成一个entitlements文件,而后再须要的时候往里面添加条目。当构建整个应用时,这个文件也会说起给codesign做为应用所须要拥有哪些受权的参考。这些受权信息必须都在开发者中心的AppID中启用,而且包含在配置文件中。

Code Signing Identity

配置证书

Development Team

开发者所在的群组

Other Code Signing Flags

常见的配置为--deep。用法不详。

Provisioning Profile

配置描述文件。

User-Defined

user-define

这里用户能够在debug、release或者本身定义的编译模式下设置不一样的变量,能够达到一套代码同时支持多个不一样版本的目的。好比能够编译出叫APP1和APP2两个名字不同的APP。

Packaging

Packaging-01

Defines Module

是否认义模块。默认app类的工程为NO,framwork工程默认为YES。

Expand Build Setting in Info.plist File

告诉编译器是否处理info.plist。默认是YES。这是一个很大的特色,由于它避免了有根据您的构建设置和配置不一样的Info.plist中,避免您在多个地方修改设置。 可是若是你真的不想要它,只需在项目或目标的构建设置中关闭此设置。

Info.plist File

建立工程后默认会建立一个info.plist文件。也能够根据须要进行主动建立。

Private Headers Folder Path

私有头文件的存放位置。

Product Bundle Identifier

产品bundle的标识

Product Module Name

产品模块名称

Product Name

产品名称

Public Headers Folder Path

公共头文件路径

Wrapper Extension

打包的扩展名,默认app。

Preprocessing