共用方式為


Xcode@2 - Xcode 組建 v2 工作

使用此工作在macOS上建置 Xcode 工作區。

Syntax

# Xcode Build v2
# Build an Xcode workspace on Mac OS.
- task: Xcode@2
  inputs:
    actions: 'build' # string. Required. Actions. Default: build.
    #configuration: '$(Configuration)' # string. Configuration. Default: $(Configuration).
    #sdk: '$(SDK)' # string. SDK. Default: $(SDK).
    #xcWorkspacePath: '**/*.xcodeproj/*.xcworkspace' # string. Workspace/Project Path. Default: **/*.xcodeproj/*.xcworkspace.
    #scheme: # string. Scheme. 
    #packageApp: true # boolean. Create App Package. Default: true.
  # Package Options
    packageTool: 'xcodebuild' # 'xcrun' | 'xcodebuild'. Required. Create Package (IPA) using. Default: xcodebuild.
    #archivePath: # string. Optional. Use when packageTool == xcodebuild. Archive Path. 
    #exportPath: 'output/$(SDK)/$(Configuration)' # string. Optional. Use when packageTool == xcodebuild. Export Path. Default: output/$(SDK)/$(Configuration).
    #exportOptions: 'auto' # 'auto' | 'plist' | 'specify'. Optional. Use when packageTool == xcodebuild. Export Options. Default: auto.
    #exportMethod: 'development' # string. Required when exportOptions == specify. Export Method. Default: development.
    #exportTeamId: # string. Optional. Use when exportOptions == specify. Team ID. 
    #exportOptionsPlist: # string. Required when exportOptions == plist. Export Options Plist. 
  # Signing & Provisioning
    #xcode8AutomaticSigning: false # boolean. Automatic Signing. Default: false.
    #teamId: # string. Optional. Use when xcode8AutomaticSigning = true. Team ID. 
    #signMethod: 'file' # 'file' | 'id'. Override Using. Default: file.
    #iosSigningIdentity: # string. Optional. Use when signMethod = id. Signing Identity. 
    #unlockDefaultKeychain: false # boolean. Optional. Use when signMethod = id. Unlock Default Keychain. Default: false.
    #defaultKeychainPassword: # string. Optional. Use when signMethod = id. Default Keychain Password. 
    #provProfileUuid: # string. Optional. Use when signMethod = id. Provisioning Profile UUID. 
    #p12: # string. Optional. Use when signMethod = file. P12 Certificate File. 
    #p12pwd: # string. Optional. Use when signMethod = file. P12 Password. 
    #provProfile: # string. Optional. Use when signMethod = file. Provisioning Profile File. 
    #removeProfile: false # boolean. Optional. Use when signMethod = file. Remove Profile After Build. Default: false.
  # Advanced
    #args: # string. Arguments. 
    #cwd: # string. Working Directory. 
    outputPattern: 'output/$(SDK)/$(Configuration)' # string. Required. Output Directory. Default: output/$(SDK)/$(Configuration).
    #xcodeDeveloperDir: # string. Xcode Developer Path. 
    #useXcpretty: false # boolean. Use xcpretty. Default: false.
    #publishJUnitResults: false # boolean. Publish to VSTS/TFS. Default: false.
  # xctool (deprecated)
    #useXctool: # boolean. Use xctool. 
    #xctoolReporter: # string. xctool Test Reporter Format.

輸入

actions - 行動
string. 必要。 預設值:build

指定以空格分隔的動作清單。 有效的選項為 buildcleantestanalyzearchive。 例如, build clean 執行全新組建。 請參閱 Apple:使用 Xcode 常見問題從命令行建置。


configuration - 配置
string. 預設值:$(Configuration)

指定要建置的 Xcode 專案或工作區組態。 使用變數時,請在 [變數] 索引標籤上指定值 (,例如 Release ,) 。


sdk - Sdk
string. 預設值:$(SDK)

根據指定的 SDK 建置 Xcode 專案或工作區。 執行 xcodebuild -showsdks 以查看有效的 SDK 清單。


xcWorkspacePath - 工作區/項目路徑
string. 預設值:**/*.xcodeproj/*.xcworkspace

選擇性。 指定從存放庫根目錄到 Xcode 工作區或項目的相對路徑。 例如:MyApp/MyApp.xcworkspaceMyApp/MyApp.xcworkspace/MyApp.xcodeproj
如果您想要在 [進階自變數] 下使用 -target flag ,請保留空白。


scheme - 方案
string.

選擇性。 指定 Xcode 設定名稱。 必須是 Xcode ) 中受控配置底下的共用配置 (共用複選框。 如果已指定 Workspace,則為必要專案。


packageApp - 建立應用程式套件
boolean. 預設值:true

指定是否產生IPA做為組建的一部分。 若要使用 Xcode 7 和 Xcode 8 匯出封存,請檢閱套件 選項 一節中的其他輸入。


packageTool - 使用 建立套件 (IPA)
string. 必要。 允許的值: xcrun (xcrun (由 Apple) ) 取代、 xcodebuild (xcodebuild 封存和導出) 。 預設值:xcodebuild

指定要用於產生 IPA 的工具。


archivePath - 封存路徑
string. 選擇性。 使用 時 packageTool == xcodebuild

指定放置已建立封存的目錄。


exportPath - 匯出路徑
string. 選擇性。 使用 時 packageTool == xcodebuild。 預設值:output/$(SDK)/$(Configuration)

指定從封存匯出的產品目的地。


exportOptions - 匯出選項
string. 選擇性。 使用 時 packageTool == xcodebuild。 允許值:autoplistspecify。 預設值:auto

指定匯出封存時傳入 匯出選項 的方法。


exportMethod - Export 方法
string. 當 exportOptions == specify 時為必要。 預設值:development

指定 Xcode 用來匯出封存的方法。 例如,app-storepackagead-hocenterprisedevelopment


exportTeamId - 小組標識碼
string. 選擇性。 使用 時 exportOptions == specify

指定要用於導出的Apple Developer Portal 10位數小組標識碼。


exportOptionsPlist - 匯出選項 Plist
string. 當 exportOptions == plist 時為必要。

指定設定封存匯出之 plist 檔案的路徑。


xcode8AutomaticSigning - 自動簽署
boolean. 預設值:false

如果您有設定為自動簽署的 Xcode 8 或 Xcode 9 專案,請使用此輸入。


teamId - 小組標識碼
string. 選擇性。 使用 時 xcode8AutomaticSigning = true

指定10位數的開發人員小組標識碼。 如果您是多個開發小組的成員,則需要此專案。


signMethod - 使用覆寫
string. 允許的值: file (檔案內容) , id (識別子) 。 預設值:file

如果組建使用與預設值不同的簽署或布建方法,請使用此輸入。 選擇 File Contents 使用 P12 憑證和布建配置檔。 選擇 Identifiers 從預設金鑰鏈和預安裝的設定檔擷取簽署設定。 如果您不想覆寫預設組建設定,請將對應的欄位保留空白。


iosSigningIdentity - 簽署身分識別
string. 選擇性。 使用 時 signMethod = id

指定用來簽署組建的簽署身分識別覆寫。 預設為 Xcode 項目設定。 可能需要選取 [解除鎖定預設密鑰鏈]。


unlockDefaultKeychain - 解除鎖定預設金鑰鏈
boolean. 選擇性。 使用 時 signMethod = id。 預設值:false

藉由解除鎖定預設的密鑰鏈,解決 不允許使用者互動 的錯誤。


defaultKeychainPassword - 預設金鑰鏈密碼
string. 選擇性。 使用 時 signMethod = id

指定要解除鎖定預設金鑰鏈的密碼。


provProfileUuid - 布建配置檔 UUID
string. 選擇性。 使用時機 signMethod = id

指定要用於組建之已安裝布建配置檔的 UUID。 在 iOS、WatchKit、tvOS () 的單一工作區中,使用不同的配置或目標來指定布建配置檔。


p12 - P12 憑證檔案
string. 選擇性。 使用時機 signMethod = file

指定 PKCS12 格式化 P12 憑證檔案的相對路徑,其中包含要用於組建的簽署憑證。


p12pwd - P12 密碼
string. 選擇性。 使用時機 signMethod = file

指定 P12 憑證檔案的密碼。 使用組建變數加密。


provProfile - 布建配置檔案
string. 選擇性。 使用時機 signMethod = file

指定檔案的相對路徑,其中包含要用於組建的布建配置檔覆寫。 在 iOS、WatchKit、tvOS () 的單一工作區中,使用不同的配置或目標來指定布建配置檔。


removeProfile - 在建置後移除配置檔
boolean. 選擇性。 使用時機 signMethod = file。 預設值:false

在建置完成後,從組建代理程式移除布建配置文件的內容。 只檢查您是否正在每個使用者執行一個代理程式。


args - 參數
string.

指定用來建置的其他命令行自變數。 如果您想要使用 -target-project ,而不是指定工作區和配置,此輸入會很有用。


cwd - 工作目錄
string.

指定組建執行的工作目錄。 預設為存放庫的根目錄。


outputPattern - 輸出目錄
string. 必要。 預設值:output/$(SDK)/$(Configuration)

指定放置建置輸出 (二進位檔) 的相對路徑。


xcodeDeveloperDir - Xcode 開發人員路徑
string.

選擇性。 如果不是系統預設值,則指定 Xcode Developer 資料夾的路徑。 用於在系統上安裝多個 Xcode 版本時使用。 例如:/Applications/Xcode 7.app/Contents/Developer


useXcpretty - 使用 xcpretty
boolean. 預設值:false

格式化 xcodebuild 輸出併產生 JUnit 測試結果報告。 必須安裝在代理程式主機上。 深入瞭解 xcpretty


publishJUnitResults - 發佈至 VSTS/TFS
boolean. 預設值:false

使用 xctool 所產生的 JUnit 測試結果會發佈至 VSTS/TFS。


useXctool - 使用 xctool
boolean.

使用 xctool 而不是 xcodebuild。 必須安裝在代理程式主機上。 深入瞭解 xctool
注意:xctool 已被取代,且不適用於 Xcode 8。


xctoolReporter - xctool 測試報告程式格式
string.

測試在指定 測試 動作並檢查 [使用 xctool ] 時要使用的報告程式格式。 指定 junit:output-file-path-here.xml 以產生與發行測試結果工作相容的檔格式。 指定時,會自動新增 純文本xctool 必須安裝在代理程式主機上。 深入瞭解 xctool
注意:xctool 已被取代,且不適用於 Xcode 8。


工作控制選項

除了工作輸入之外,所有工作都有控制選項。 如需詳細資訊,請參閱 控件選項和一般工作屬性

輸出變數

無。

規格需求

需求 描述
管線類型 YAML,傳統組建
執行於 Agent、DeploymentGroup
要求 自我裝載代理程式必須具備符合下列需求的功能,才能執行使用此工作的作業:xcode
Capabilities 此工作不符合作業中後續工作的任何需求。
命令限制 任何
Settable 變數 任何
代理程式版本 所有支援的代理程式版本。
工作類別 建置