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
。
指定以空格分隔的作列表。 一些有效选项包括 build
、clean
、test
、analyze
和 archive
。 例如,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.xcworkspace
或 MyApp/MyApp.xcodeproj
。 可以使用通配符。 详细了解 文件匹配模式。
scheme
-
方案
string
。
可选。 指定 Xcode 方案名称。 必须是共享方案(Xcode 中 托管方案 下的共享复选框)。 如果未指定方案,并且指定的工作区具有单个共享方案,将使用工作区方案。
xcodeVersion
-
Xcode 版本
string
。 允许的值:8
(Xcode 8)、9
(Xcode 9)、10
(Xcode 10)、11
(Xcode 11)、12
(Xcode 12)、13
(Xcode 13)、default
、specifyPath
(指定路径)。 默认值: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)、default
、specifyPath
(指定路径)。 默认值: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
(自动)、plist
、specify
。 默认值:auto
。
指定用于导出存档的选项。 选择 Automatic
的默认值后,会自动从存档中检测导出方法。 选择 Plist
以指定包含导出选项的 plist 文件。 选择 Specify
以提供特定的 导出方法 和 团队 ID。
exportMethod
-
Export 方法
string
。
exportOptions == specify
时是必需的。 默认值:development
。
指定 Xcode 用于导出存档的方法。 例如:app-store
、package
、ad-hoc
、enterprise
或 development
。
exportTeamId
-
团队 ID
string
。 可选。 当 exportOptions == specify
时使用。
指定要在导出过程中使用的 Apple 开发人员门户 10 个字符的团队 ID。
exportOptionsPlist
-
导出选项 plist
string
。
exportOptions == plist
时是必需的。
指定包含导出过程中要使用的选项的 plist 文件的路径。
exportArgs
-
导出参数
string
。 可选。 当 packageApp == true
时使用。
指定导出期间使用的其他命令行参数。
signingOption
-
签名样式
string
。 允许的值:nosign
(请勿使用代码符号)、default
(项目默认值)、manual
(手动签名)、auto
(自动签名)。 默认值:nosign
。
指定对生成进行签名的方法。 选择 Do not code sign
以禁用签名。 选择 Project defaults
以仅使用项目的签名配置。 选择 Manual signing
以强制手动签名,并选择指定签名标识和预配配置文件。 选择 Automatic signing
以强制自动签名,并选择指定开发团队 ID。 如果项目需要签名,请使用 安装 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
-
团队 ID
string
。 可选。 当 signingOption = auto
时使用。
如果你是多个开发团队的成员,则是必需的。 指定 10 个字符的开发团队 ID。
destinationPlatformOption
-
目标平台
string
。 允许的值:default
、iOS
(iOS 和 watchOS)、tvOS
、macOS
、custom
。 默认值: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=<versionNumber>
格式指定可选的目标 OS 版本,例如 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=<versionNumber>
格式指定可选的目标 OS 版本,例如 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
-
工作目录
输入别名:cwd
。
string
。
可选。 指定要在其中运行生成的工作目录。 如果未输入任何值,则使用存储库的根目录。
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
时使用。
如果已启用 xcpretty
和 publishJUnitResults
,则可以指定测试运行标题。
任务控制选项
除任务输入之外,所有任务都具有控制选项。 有关详细信息,请参阅 控件选项和常见任务属性。
输出变量
没有。
注解
使用此任务可在 macOS 上生成、测试或存档 Xcode 工作区,并选择性地打包应用。
使用多个预配配置文件
目前不支持 Xcode 任务的多个预配配置文件(例如 iOS 应用扩展)。