And we have a Step for that too! recreate-user-schemes
I believe it uses the same ruby gem under the hood.
With this I could finally almost build the project, one last issue:
Check dependencies
Signing for "cutePuppyPics" requires a development team. Select a development team in the project editor.
Code signing is required for product type 'Application' in SDK 'iOS 10.2'
Which is what I mentioned earlier (Can I use Bitrise to automatically build (and deploy) Ionic 2 (Cordova) based apps?), that the default code signing settings generated by ionic are not compatible with Xcode 8, you have to manually set the Team in Xcode project, or you have to force this parameter somehow.
Forcing is possible, although it’s almost always not the best long term solution. Anyway, if you force the Team ID as a build / command line param, you’ll get one more error:
Check dependencies
cutePuppyPics has conflicting provisioning settings. cutePuppyPics 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 is required for product type 'Application' in SDK 'iOS 10.2'
To fix this you have to force both the Team ID and the Identity as build params, so the build-ios
workflow looks like this:
build-ios:
envs:
- BITRISE_PROJECT_PATH: ./platforms/ios/cutePuppyPics.xcodeproj
- BITRISE_SCHEME: cutePuppyPics
steps:
- change-workdir@1.0.1:
title: Change workdir to ionic project dir
inputs:
- path: $IONIC_PROJ_DIR_PATH
- is_create_path: "false"
- script@1.1.3:
title: Build the app for distribution
inputs:
- content: |-
#!/bin/bash
set -ex
#
npm install
mkdir -p www
ionic platform add ios
ionic build ios --prod
- recreate-user-schemes:
inputs:
- project_path: $BITRISE_PROJECT_PATH
- certificate-and-profile-installer@1.8.2: {}
- xcode-archive@2.0.4:
inputs:
- force_team_id: 72SA8V3WYL
- force_code_sign_identity: iPhone Developer
Full bitrise.yml config: https://github.com/bitrise-samples/ionic-2/blob/master/bitrise.yml
With this config, and with the related code signing files, it finally worked, on the Xcode “Edge” stack:
+------------------------------------------------------------------------------+
| bitrise summary |
+---+---------------------------------------------------------------+----------+
| | title | time (s) |
+---+---------------------------------------------------------------+----------+
| - | activate-ssh-key@3.1.1 | 1.31 sec |
+---+---------------------------------------------------------------+----------+
| âś“ | git-clone@3.4.1 | 6.79 sec |
+---+---------------------------------------------------------------+----------+
| âś“ | Change workdir to ionic project dir | 2.05 sec |
+---+---------------------------------------------------------------+----------+
| âś“ | Build the app for distribution | 128 sec |
+---+---------------------------------------------------------------+----------+
| âś“ | recreate-user-schemes | 9.35 sec |
+---+---------------------------------------------------------------+----------+
| âś“ | certificate-and-profile-installer@1.8.2 | 6.62 sec |
+---+---------------------------------------------------------------+----------+
| âś“ | xcode-archive@2.0.4 | 29 sec |
+---+---------------------------------------------------------------+----------+
| âś“ | deploy-to-bitrise-io@1.2.6 | 7.73 sec |
+---+---------------------------------------------------------------+----------+
| Total runtime: 191 sec |
+------------------------------------------------------------------------------+
But it’s way too complicated for someone not deeply familiar with how Xcode works… We’ll have to find a better way to handle this.