共用方式為


Xcode@5 - Xcode v5 工作

使用此工作在 macOS 上建置、測試或封存 Xcode 工作區,並選擇性地封裝應用程式。

語法

# Xcode v5
# Build, test, or archive an Xcode workspace on macOS. Optionally package an app.
- task: Xcode@5
  inputs:
    actions: 'build' # string. Required. Actions. Default: build.
    #configuration: '$(Configuration)' # string. Configuration. Default: $(Configuration).
    #sdk: '$(SDK)' # string. SDK. Default: $(SDK).
    #xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace' # string. Workspace or project path. Default: **/*.xcodeproj/project.xcworkspace.
    #scheme: # string. Scheme. 
    #xcodeVersion: 'default' # '8' | '9' | '10' | '11' | '12' | '13' | 'default' | 'specifyPath'. Xcode version. Default: default.
    #xcodeDeveloperDir: # string. Optional. Use when xcodeVersion == specifyPath. Xcode developer path. 
  # Package options
    #packageApp: false # boolean. Create app package. Default: false.
    #archivePath: # string. Optional. Use when packageApp == true. Archive path. 
    #exportPath: 'output/$(SDK)/$(Configuration)' # string. Optional. Use when packageApp == true. Export path. Default: output/$(SDK)/$(Configuration).
    #exportOptions: 'auto' # 'auto' | 'plist' | 'specify'. Optional. Use when packageApp == true. 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. 
    #exportArgs: # string. Optional. Use when packageApp == true. Export arguments. 
  # Signing & provisioning
    #signingOption: 'nosign' # 'nosign' | 'default' | 'manual' | 'auto'. Signing style. Default: nosign.
    #signingIdentity: # string. Optional. Use when signingOption = manual. Signing identity. 
    #provisioningProfileUuid: # string. Optional. Use when signingOption = manual. Provisioning profile UUID. 
    #provisioningProfileName: # string. Optional. Use when signingOption = manual. Provisioning profile name. 
    #teamId: # string. Optional. Use when signingOption = auto. Team ID. 
  # Devices & simulators
    #destinationPlatformOption: 'default' # 'default' | 'iOS' | 'tvOS' | 'macOS' | 'custom'. Destination platform. Default: default.
    #destinationPlatform: # string. Optional. Use when destinationPlatformOption == custom. Custom destination platform. 
    #destinationTypeOption: 'simulators' # 'simulators' | 'devices'. Optional. Use when destinationPlatformOption != default && destinationPlatformOption != macOS. Destination type. Default: simulators.
    #destinationSimulators: # string. Optional. Use when destinationPlatformOption != default && destinationPlatformOption != macOS && destinationTypeOption == simulators. Simulator. 
    #destinationDevices: # string. Optional. Use when destinationPlatformOption != default && destinationPlatformOption != macOS && destinationTypeOption == devices. Device. 
  # Advanced
    #args: # string. Arguments. 
    #workingDirectory: # string. Alias: cwd. Working directory. 
    #useXcpretty: true # boolean. Use xcpretty. Default: true.
    #xcprettyArgs: # string. Optional. Use when useXcpretty == true. Xcpretty arguments. 
    #publishJUnitResults: false # boolean. Publish test results to Azure Pipelines. Default: false.
    #testRunTitle: # string. Optional. Use when publishJUnitResults == true. Test run title.
# Xcode v5
# Build, test, or archive an Xcode workspace on macOS. Optionally package an app.
- task: Xcode@5
  inputs:
    actions: 'build' # string. Required. Actions. Default: build.
    #configuration: '$(Configuration)' # string. Configuration. Default: $(Configuration).
    #sdk: '$(SDK)' # string. SDK. Default: $(SDK).
    #xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace' # string. Workspace or project path. Default: **/*.xcodeproj/project.xcworkspace.
    #scheme: # string. Scheme. 
    #xcodeVersion: 'default' # '8' | '9' | '10' | '11' | 'default' | 'specifyPath'. Xcode version. Default: default.
    #xcodeDeveloperDir: # string. Optional. Use when xcodeVersion == specifyPath. Xcode developer path. 
  # Package options
    #packageApp: false # boolean. Create app package. Default: false.
    #archivePath: # string. Optional. Use when packageApp == true. Archive path. 
    #exportPath: 'output/$(SDK)/$(Configuration)' # string. Optional. Use when packageApp == true. Export path. Default: output/$(SDK)/$(Configuration).
    #exportOptions: 'auto' # 'auto' | 'plist' | 'specify'. Optional. Use when packageApp == true. 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. 
    #exportArgs: # string. Optional. Use when packageApp == true. Export arguments. 
  # Signing & provisioning
    #signingOption: 'nosign' # 'nosign' | 'default' | 'manual' | 'auto'. Signing style. Default: nosign.
    #signingIdentity: # string. Optional. Use when signingOption = manual. Signing identity. 
    #provisioningProfileUuid: # string. Optional. Use when signingOption = manual. Provisioning profile UUID. 
    #provisioningProfileName: # string. Optional. Use when signingOption = manual. Provisioning profile name. 
    #teamId: # string. Optional. Use when signingOption = auto. Team ID. 
  # Devices & simulators
    #destinationPlatformOption: 'default' # 'default' | 'iOS' | 'tvOS' | 'macOS' | 'custom'. Destination platform. Default: default.
    #destinationPlatform: # string. Optional. Use when destinationPlatformOption == custom. Custom destination platform. 
    #destinationTypeOption: 'simulators' # 'simulators' | 'devices'. Optional. Use when destinationPlatformOption != default && destinationPlatformOption != macOS. Destination type. Default: simulators.
    #destinationSimulators: # string. Optional. Use when destinationPlatformOption != default && destinationPlatformOption != macOS && destinationTypeOption == simulators. Simulator. 
    #destinationDevices: # string. Optional. Use when destinationPlatformOption != default && destinationPlatformOption != macOS && destinationTypeOption == devices. Device. 
  # Advanced
    #args: # string. Arguments. 
    #workingDirectory: # string. Alias: cwd. Working directory. 
    #useXcpretty: true # boolean. Use xcpretty. Default: true.
    #xcprettyArgs: # string. Optional. Use when useXcpretty == true. Xcpretty arguments. 
    #publishJUnitResults: false # boolean. Publish test results to Azure Pipelines. Default: false.
    #testRunTitle: # string. Optional. Use when publishJUnitResults == true. Test run title.
# Xcode v5
# Build, test, or archive an Xcode workspace on macOS. Optionally package an app.
- task: Xcode@5
  inputs:
    actions: 'build' # string. Required. Actions. Default: build.
    #configuration: '$(Configuration)' # string. Configuration. Default: $(Configuration).
    #sdk: '$(SDK)' # string. SDK. Default: $(SDK).
    #xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace' # string. Workspace or project path. Default: **/*.xcodeproj/project.xcworkspace.
    #scheme: # string. Scheme. 
    #xcodeVersion: 'default' # '8' | '9' | '10' | '11' | 'default' | 'specifyPath'. Xcode version. Default: default.
    #xcodeDeveloperDir: # string. Optional. Use when xcodeVersion == specifyPath. Xcode developer path. 
  # Package options
    #packageApp: false # boolean. Create app package. Default: false.
    #archivePath: # string. Optional. Use when packageApp == true. Archive path. 
    #exportPath: 'output/$(SDK)/$(Configuration)' # string. Optional. Use when packageApp == true. Export path. Default: output/$(SDK)/$(Configuration).
    #exportOptions: 'auto' # 'auto' | 'plist' | 'specify'. Optional. Use when packageApp == true. 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. 
    #exportArgs: # string. Optional. Use when packageApp == true. Export arguments. 
  # Signing & provisioning
    #signingOption: 'nosign' # 'nosign' | 'default' | 'manual' | 'auto'. Signing style. Default: nosign.
    #signingIdentity: # string. Optional. Use when signingOption = manual. Signing identity. 
    #provisioningProfileUuid: # string. Optional. Use when signingOption = manual. Provisioning profile UUID. 
    #provisioningProfileName: # string. Optional. Use when signingOption = manual. Provisioning profile name. 
    #teamId: # string. Optional. Use when signingOption = auto. Team ID. 
  # Devices & simulators
    #destinationPlatformOption: 'default' # 'default' | 'iOS' | 'tvOS' | 'macOS' | 'custom'. Destination platform. Default: default.
    #destinationPlatform: # string. Optional. Use when destinationPlatformOption == custom. Custom destination platform. 
    #destinationTypeOption: 'simulators' # 'simulators' | 'devices'. Optional. Use when destinationPlatformOption != default && destinationPlatformOption != macOS. Destination type. Default: simulators.
    #destinationSimulators: 'iPhone 7' # string. Optional. Use when destinationPlatformOption != default && destinationPlatformOption != macOS && destinationTypeOption == simulators. Simulator. Default: iPhone 7.
    #destinationDevices: # string. Optional. Use when destinationPlatformOption != default && destinationPlatformOption != macOS && destinationTypeOption == devices. Device. 
  # Advanced
    #args: # string. Arguments. 
    #workingDirectory: # string. Alias: cwd. Working directory. 
    #useXcpretty: true # boolean. Use xcpretty. Default: true.
    #publishJUnitResults: false # boolean. Publish test results to Azure Pipelines. Default: false.

輸入

actions - 動作
string。 必須的。 預設值:build

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


configuration - 組態
string。 預設值:$(Configuration)

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


sdk - SDK
string。 預設值:$(SDK)

指定要在建置 Xcode 專案或工作區時使用的 SDK。 從 macOS 終端機應用程式,執行 xcodebuild -showsdks 以顯示有效的 SDK 清單。 使用變數時,請在 [變數] 索引標籤上指定值(例如,iphonesimulator)。


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

選擇性。 指定從存放庫根目錄到 Xcode 工作區或項目的相對路徑。 例如,MyApp/MyApp.xcworkspaceMyApp/MyApp.xcodeproj。 可使用萬用字元。 深入瞭解 檔案比對模式


scheme - 方案
string

選擇性。 指定 Xcode 設定名稱。 必須是共用配置(Xcode 中 Managed Schemes 底下的共用複選框)。 如果您未指定配置,且指定的工作區具有單一共享配置,則會使用工作區配置。


xcodeVersion - Xcode 版本
string。 允許的值:8(Xcode 8)、9(Xcode 9)、10(Xcode 10)、11(Xcode 11)、12(Xcode 12)、13(Xcode 13)、defaultspecifyPath(指定路徑)。 預設值:default

指定 Xcode 的目標版本。 選取 [Default],以在代理程式計算機上使用預設版本的 Xcode。 指定版本號碼(例如,Xcode 9)依賴代理程式計算機上的環境變數所設定的版本位置(例如,XCODE_9_DEVELOPER_DIR=/Applications/Xcode_9.0.0.app/Contents/Developer)。 選取 [Specify path,以提供 Xcode 開發人員目錄的特定路徑。


xcodeVersion - Xcode 版本
string。 允許的值:8(Xcode 8)、9(Xcode 9)、10(Xcode 10)、11(Xcode 11)、defaultspecifyPath(指定路徑)。 預設值:default

指定 Xcode 的目標版本。 選取 [Default],以在代理程式計算機上使用預設版本的 Xcode。 指定版本號碼(例如,Xcode 9)依賴代理程式計算機上的環境變數所設定的版本位置(例如,XCODE_9_DEVELOPER_DIR=/Applications/Xcode_9.0.0.app/Contents/Developer)。 選取 [Specify path,以提供 Xcode 開發人員目錄的特定路徑。


xcodeDeveloperDir - Xcode 開發人員路徑
string。 選擇性。 xcodeVersion == specifyPath時使用 。

指定特定 Xcode 開發人員目錄的路徑(例如,/Applications/Xcode_9.0.0.app/Contents/Developer)。 當代理程式電腦上安裝多個版本的 Xcode 時,此輸入很有用。


packageApp - 建立應用程式套件
boolean。 預設值:false

指定IPA應用程式套件檔案是否產生為組建的一部分。


archivePath - 封存路徑
string。 選擇性。 packageApp == true時使用 。

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


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

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


exportOptions - 匯出選項
string。 選擇性。 packageApp == true時使用 。 允許的值:auto(自動)、plistspecify。 預設值:auto

指定匯出封存的選項。 選取 Automatic 的預設值時,會自動從封存偵測導出方法。 選取 [Plist],以指定包含導出選項的 plist 檔案。 選取 [Specify],以提供特定 Export 方法Team ID


exportMethod - Export 方法
stringexportOptions == specify時為必要項。 預設值:development

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


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

指定導出期間要使用的Apple Developer Portal 10 個字元小組標識碼。


exportOptionsPlist - 匯出選項 plist
stringexportOptions == plist時為必要項。

指定 plist 檔案的路徑,其中包含匯出期間要使用的選項。


exportArgs - 導出自變數
string。 選擇性。 packageApp == true時使用 。

指定匯出期間使用的其他命令行自變數。


signingOption - 簽署樣式
string。 允許的值:nosign(不要代碼符號)、default(項目預設值)、manual(手動簽署)、auto(自動簽署)。 預設值:nosign

指定簽署組建的方法。 選取 [Do not code sign] 以停用簽署。 選取 [Project defaults,只使用專案的簽署組態。 選取 [Manual signing],強制手動簽署,並選擇性地指定簽署身分識別和布建配置檔。 選取 [Automatic signing],強制自動簽署,並選擇性地指定開發小組標識符。 如果您的專案需要簽署,請使用 安裝 Apple... 工作,在 Xcode 組建之前安裝憑證和布建配置檔。


signingIdentity - 簽署身分識別
string。 選擇性。 signingOption = manual時使用 。

指定要用來簽署組建的簽署身分識別覆寫。 可能需要解除鎖定代理程式電腦上的預設金鑰鏈。 如果未輸入任何值,則會使用 Xcode 項目的設定。


provisioningProfileUuid - 布建配置檔 UUID
string。 選擇性。 signingOption = manual時使用 。

指定用於組建的已安裝布建配置檔的 UUID。 使用具有不同配置或目標的個別建置工作,在單一工作區中依目標指定布建配置檔(iOS、tvOS、watchOS)。


provisioningProfileName - 布建配置檔名稱
string。 選擇性。 signingOption = manual時使用 。

指定用於組建的已安裝布建配置檔名稱。 如果指定,這會優先於布建配置檔 UUID。 使用具有不同配置或目標的個別建置工作,在單一工作區中依目標指定布建配置檔(iOS、tvOS、watchOS)。


teamId - 小組標識碼
string。 選擇性。 signingOption = auto時使用 。

如果您是多個開發小組的成員,則為必要專案。 指定10個字元的開發小組標識碼。


destinationPlatformOption - 目的地平臺
string。 允許的值:defaultiOS(iOS 和 watchOS)、tvOSmacOScustom。 預設值:default

指定一般建置裝置無效時,用於UI測試的目的地裝置平臺。 選擇 [Custom],以指定此列表中未包含的平臺。 選取 Default 時,不會將模擬器或裝置設為目標。


destinationPlatform - 自定義目的地平臺
string。 選擇性。 destinationPlatformOption == custom時使用 。

指定一般建置裝置無效時,用於UI測試的目的地裝置平臺。 選擇 [Custom] 以指定清單中未包含的平臺。 選取 Default 時,不會將模擬器或裝置設為目標。


destinationTypeOption - 目的地類型
string。 選擇性。 destinationPlatformOption != default && destinationPlatformOption != macOS時使用 。 允許的值:simulators(模擬器)、devices(連線裝置)。 預設值:simulators

指定要用於 UI 測試的目的地類型。 裝置必須透過纜線或網路連線到執行組建的Mac。 如需詳細資訊,請參閱 Xcode 中的 裝置和模擬器


destinationSimulators - 模擬器
string。 選擇性。 destinationPlatformOption != default && destinationPlatformOption != macOS && destinationTypeOption == simulators時使用 。

指定用於 UI 測試的 Xcode 模擬器名稱。 例如,iPhone X (iOS 和 watchOS) 或 Apple TV 4K (tvOS)。 選擇性的目標 OS 版本可以使用 OS=<versionNumber>格式來指定,例如 iPhone X,OS=11.1。 如需詳細資訊,請參閱此 安裝在 Hosted macOS 代理程式 上的模擬器清單。


destinationSimulators - 模擬器
string。 選擇性。 destinationPlatformOption != default && destinationPlatformOption != macOS && destinationTypeOption == simulators時使用 。 預設值:iPhone 7

指定用於 UI 測試的 Xcode 模擬器名稱。 例如,iPhone X (iOS 和 watchOS) 或 Apple TV 4K (tvOS)。 選擇性的目標 OS 版本可以使用 OS=<versionNumber>格式來指定,例如 iPhone X,OS=11.1。 如需詳細資訊,請參閱此 安裝在 Hosted macOS 代理程式 上的模擬器清單。


destinationDevices - 裝置
string。 選擇性。 destinationPlatformOption != default && destinationPlatformOption != macOS && destinationTypeOption == devices時使用 。

指定用於 UI 測試的裝置名稱,例如 Raisa's iPad。 目前僅支援一個裝置。 請注意,Apple 不允許裝置名稱中的單引號 (')。 相反地,可以使用右單引號(')。


args - 自變數
string

選擇性。 指定要建置的其他命令行自變數。 此輸入適用於指定 -target-project 自變數,而不是工作區/專案和配置。 請參閱 Apple:使用 Xcode 常見問題從命令列建置


workingDirectory - 工作目錄
輸入別名:cwdstring

選擇性。 指定要在其中執行組建的工作目錄。 如果未輸入任何值,則會使用存放庫的根目錄。


useXcpretty - 使用 xcpretty
boolean。 預設值:true

指定是否要使用 xcpretty 來格式化 xcodebuild 輸出。 xcpretty 必須安裝在代理程序機器上(它預安裝在 Azure Pipelines 裝載的組建代理程式上)。 如果未安裝 xcpretty,則會顯示原始 xcodebuild 輸出。 如需詳細資訊,請參閱 xcpretty


xcprettyArgs - Xcpretty 自變數
string。 選擇性。 useXcpretty == true時使用 。

如果已啟用 xcpretty,此輸入會指定 xcpretty的自變數。 請參閱 GitHub上的 xcpretty 自變數清單。


publishJUnitResults - 將測試結果發佈至 Azure Pipelines
boolean。 預設值:false

指定是否要將 JUnit 測試結果發佈至 Azure Pipelines。 這需要啟用 xcpretty 才能產生 JUnit 測試結果。


testRunTitle - 測試回合標題
string。 選擇性。 publishJUnitResults == true時使用 。

如果已啟用 xcprettypublishJUnitResults,您可以指定測試回合標題。


工作控制選項

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

輸出變數

沒有。

備註

使用此工作在 macOS 上建置、測試或封存 Xcode 工作區,並選擇性地封裝應用程式。

使用多個布建配置檔

目前不支援 Xcode 工作的多個佈建配置檔(例如 iOS 應用程式延伸模組)。

範例

建置 Xcode 應用程式

需求

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