Using VSTS to build and deploy ionic app to both android and IOS Using VSTS to build and deploy ionic app to both android and IOS xcode xcode

Using VSTS to build and deploy ionic app to both android and IOS


After trying both manual and automatic signing with no joy, I finally got it to work with a few minor tweaks.

  1. When installing the apple certificate, select temporary keychain and supply a password. If you don't use this the build agent will be waiting for user input to type the keychain password causing the build to timeout.
  2. Switch to manual signing.
  3. In the apple certificate install task and the Xcode build task to set the "Certificate Signing Identity" equal to the full name of the cert including the team name in brackets.


In my case, I was able to build, archive and export the ionic iOS App integrating a build.json file in the project structure, at root level:

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

Notice that in my case I wanted to generate and ad-hoc distribution, but you can generate the app for the store, development or enterprise distribution.

Once the project is prepared and built, an exportOptions.plist file is generated in the iOS Cordova project with all the configuration to export the app and generate the IPA file.

Take a look at the cordova documentation about using build.json here: https://cordova.apache.org/docs/en/latest/guide/platforms/ios/

Then, In the Xcode VSTS task, I followed all the recommendations from @psyco :Manual signing using the full name for the signing identity and the provisioning profile UUID.

Also take into account that for the provisioning profile name, Xcode 9 (the one used by default on VSTS Mac OS Agents at this moment) does not accept Xcode-generated Provisioning Profile (with "XC iOS" in the name), mine was like that and was weird to find the solution, thanks to CœurXcode 9: Provisioning profile is Xcode managed, but signing settings require a manually managed profile

With all those things, finally I was able to do it, and also to send the IPA to App Center using another VSTS task, so the IC cycle was completed.