欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

詳解Xcode編譯選項功能

 更新時間:2018年01月22日 14:45:05   投稿:laozhang  
本篇文章詳細分析了一下Xcode編譯選項功能以及相關(guān)的介紹,有這方面需要的參考學(xué)下下。

以下所有編譯選項都基于Xcode 4.6。本文基于Apple Xcode文檔、《Professional Xcode 3》、以及Google搜索結(jié)果翻譯而成。我對于編譯認識較淺。如有解釋不當(dāng)?shù)牡胤秸堈徑狻T谀承┓g可能會不恰當(dāng)?shù)牡胤?,都附上了英文原文?/p>

Architectures 架構(gòu)

Additional SDKs

在編譯的時候需要附加的SDK。

Architectures

支持的處理器架構(gòu)。不同的處理器對應(yīng)不同版本的iPhone。

其中支持Armv6的設(shè)備為:

* iPhone1

* iPhone3G

* iPod Touch 1

* iPod Touch 2

支持Armv7的設(shè)備為:

* iPhone 3GS

* iPhone 4

*iPad

* The New iPad

* iPod Touch 3G

* iPod Touch 4

支持Armv7s的設(shè)備為:

* iPhone5

iPhone對于指令集是向下兼容的。高版本的iPhone可以運行低版本的指令集。因此要適應(yīng)全系列的iPhone,Architectures應(yīng)選擇Armv6。

Base SDK

這決定了你的app所能支持的iOS最高版本。如果你選擇了iOS6.1,則你的app只能被iOS 6.1.X以下的系統(tǒng)安裝。Xcode默認設(shè)置為能夠支持的最新版本。

Build Active Architecture Only

如果此項為YES,則在Xcode會根據(jù)設(shè)備的版本只將相應(yīng)的Architecture編譯入app。如連接了iPhone4進行編譯,Build Active Architecture Only為YES,則編譯時只會構(gòu)建Armv7的二進制文件。若連接的是iPhone5,則構(gòu)建出Armv7s的二進制文件。

這個選項在Debug時默認為YES,在Release時默認為NO。這使得Debug時編譯的時間比Release快,更加方便調(diào)試。

Supported Platforms

app所支持的平臺,有iOS和OSX兩個選項。

Valid Architectures

app預(yù)期將要應(yīng)用到的架構(gòu)。默認與Architectures的值相同。這個選項讓你可以在編譯的時候只打包Armv7s架構(gòu),但是兼容Armv6,Armv7。

Build Locations

Build Products Path

產(chǎn)品文件和編譯中間文件的根目錄。產(chǎn)品文件和編譯時臨時文件都將放在這個目錄的子目錄中。

Intermediate Build Files Path

編譯時臨時文件的存放位置。編譯中間文件格式為product name+.build,如MyProduct.build。

Per-configuration Build Product Path

Directory path. Identifies the directory that holds temporary files for the active build configuration.

當(dāng)前編譯設(shè)置下的產(chǎn)品存放位置。

Per-configuration Intermediate File Path

Directory path. Identifies the directory that holds temporary files for the active build configuration.

當(dāng)前編譯設(shè)置下編譯時臨時文件的存放位置。

Precompiled Headers Cache Path

Directory path. Specifies the directory in which to place precompiled headers. Targets can share precompiled headers by specifying the same value for this build setting.

存放預(yù)編譯頭文件的位置。通過這個配置,Targets可以互相共享預(yù)編譯的頭文件。

Build Options

Build Variants

Space-separated list of identifiers. Specifies the binary variants of the product. You can create additional variant names for special purposes. For example, you can use the name of a build configuration as a variant name to create highly customized binaries.

Values:

normal: Use to produce a normal binary.

profile: Use to produce a binary that generates profile information.

debug: Use to produce a binary with debug symbols, additional assertions, and diagnostic code.

此項可以設(shè)定生成產(chǎn)品的變種。您可以創(chuàng)建額外的產(chǎn)品變種作為特殊用途。例如,您可以使用編譯配置文件的名稱來創(chuàng)建一個高度定制的二進制文件。

Build Variants的值有三個:

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

profile-用于可以生成配置信息的二進制文件

debug-用于生成帶有debug標(biāo)志、額外斷言和診斷代碼的二進制文件

Compiler for C/C++/Object-C

選擇使用的編譯器。Xcode自帶有兩種選項,Apple LLVM和LLVM GCC。建議使用默認選項---Apple LLVM。

Debug Information Format

這個選項決定了記錄debug信息的文件格式。選項有DWARF with dSYM File和DWARF。建議選擇DWARF with dSYM File。DWARF是較老的文件格式,會在編譯時將debug信息寫在執(zhí)行文件中。

Generate Profiling Code

是否生成配置代碼。默認選擇NO。

Precompiled Header Uses Files From Build Directory

預(yù)編譯build路徑中的頭文件。由于編譯過程比較耗時,且兩次編譯之間未必會改動所有文件。因此將不會改動的常用文件保留成預(yù)編譯文件將大大減少編譯時的時間。建議這一項選擇YES。

Run Static Analyzer

運行靜態(tài)分析器。

Scan All Source Files for Includes

掃描include文件所包含的所有源文件。

Validate Built Product

這個選項決定了是否在編譯的時候進行驗證。驗證的內(nèi)容和app store的審查內(nèi)容一致。默認選項是debug時不驗證,release時驗證,這樣就保證了每個release版本都會通過validate,讓被拒的風(fēng)險在提交app store之前就暴露出來,減少損失。

注意:

1. 這個選項只在連接真機的時候有效。在使用模擬器時無效。不過我用真機試了一下,似乎也沒有檢查出代碼里的私有API。

2. 想手動validate,可以在Organizer->Archives里找到需要檢查的Archive,點擊Validate按鈕即可。這樣檢查似乎靠譜些,可以查出私有API等違規(guī)操作。

相關(guān)文章

最新評論