使用VSTS为android和IOS构建和部署离子应用程序

时间:2017-11-21 14:55:27

标签: xcode ionic-framework azure-devops azure-pipelines

我有一个离子v1应用程序,我正在尝试使用Visual Studio Team Services构建定义创建应用程序的android和ios版本。该应用程序为ios和android构建。我现在已经遇到了应用程序的Xcode IOS构建问题。

ionic cordova build ios --release

上面的命令创建了ios平台以及xcode项目和工作区文件。

然后我有以下VSTS XCode任务来尝试为ios应用程序构建ipa文件。 enter image description here

我创建了p12证书和配置文件,并将它们添加到项目中。这两个都在运行构建定义时通过。

这是我的Xcode构建配置

enter image description here

此时构建定义失败,出现以下错误

Code Signing Error: App has conflicting provisioning settings. App is automatically signed for development, but a conflicting code signing identity iPhone Distribution has been manually specified. Set the code signing identity value to "iPhone Developer" in the build settings editor, or switch to manual signing in the project editor.

Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 11.1'

2 个答案:

答案 0 :(得分:3)

在尝试手动和自动签名之后没有任何快乐,我终于通过一些小的调整来实现它。

  1. 安装Apple证书时,请选择临时钥匙串并提供密码。如果你不使用它,构建代理将等待用户输入键入密钥链密码,导致构建超时。
  2. 切换到手动签名。
  3. 在Apple证书安装任务和Xcode构建任务中,将“证书签名身份”设置为等于证书的全名,包括括号中的团队名称。

答案 1 :(得分:2)

就我而言,我能够在根级别构建,存档和导出在项目结构中集成build.json文件的离子iOS应用程序:

{
   "ios": {

      "release": {
          "codeSignIdentitiy": "iPhone Distribution: TEAM_NAME (TEAM_ID)",
          "developmentTeam":"TEAM_ID",
          "provisioningProfile": "UUID",
          "packageType": "ad-hoc" 
      }
  }
}

请注意,在我的情况下,我想生成和临时分发,但您可以为商店,开发或企业分发生成应用程序。

准备和构建项目后,将在iOS Cordova项目中生成exportOptions.plist文件,其中包含导出应用程序并生成IPA文件的所有配置。

在这里查看有关使用build.json的cordova文档:https://cordova.apache.org/docs/en/latest/guide/platforms/ios/

然后,在Xcode VSTS任务中,我遵循了@psyco的所有建议: 使用签名标识的全名和配置文件UUID进行手动签名。

另请注意,对于配置配置文件名称,Xcode 9(此时默认在VSTS Mac OS Agent上使用)不接受Xcode生成的配置文件(名称中带有“XC iOS”),我是这样的,并且由于Cœur而找到解决方案很奇怪 Xcode 9: Provisioning profile is Xcode managed, but signing settings require a manually managed profile

通过所有这些,最终我能够做到这一点,并且还使用另一个VSTS任务将IPA发送到App Center,因此IC周期已经完成。