Xcode@2 - Xcode 生成 v2 任务

使用此任务可以在 macOS 上生成 Xcode 工作区。

语法

# 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 apple) ) 弃用的 (xcrun (, 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 - 团队 ID
string. 可选。 在 时 exportOptions == specify使用 。

指定要用于导出的 Apple 开发人员门户 10 位团队 ID。


exportOptionsPlist - 导出选项列表
string. 当 exportOptions == plist 时,需要此选项。

指定配置存档导出的 plist 文件的路径。


xcode8AutomaticSigning - 自动签名
boolean. 默认值:false

如果为自动签名配置了 Xcode 8 或 Xcode 9 项目,请使用此输入。


teamId - 团队 ID
string. 可选。 在 时 xcode8AutomaticSigning = true使用 。

指定 10 位开发人员团队 ID。 如果你是多个开发团队的成员,则此参数是必需的。


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 以生成与发布测试结果任务兼容的文件格式。 指定后,会自动添加 plainxctool 必须在代理主机上安装。 详细了解 xctool
注意:xctool 已弃用,不适用于 Xcode 8。


任务控制选项

除了任务输入,所有任务都有控制选项。 有关详细信息,请参阅 控制选项和常见任务属性

输出变量

无。

要求

要求 说明
管道类型 YAML,经典版本
运行平台 Agent、DeploymentGroup
需求 自承载代理必须具有满足以下要求的功能才能运行使用此任务的作业: xcode
功能 此任务不满足作业中后续任务的任何要求。
命令限制 任意
可设置变量 任意
代理版本 所有支持的代理版本。
任务类别 构建