Skip to content

Code signing with Ionic and Cordova projects

Naturally, Bitrise supports iOS applications built with either Ionic or Cordova. However, the code signing process is slightly different compared to a "native" Xcode project.

Bitrise supports both manual and automatic provisioning for Ionic and Cordova apps as well - and once again, the processes are somewhat different.

Ionic/Cordova code signing with manual provisioning

  1. Generate the native Xcode project locally from your Ionic or Cordova project by calling cordova platform add ios or ionic cordova platform add ios.

  2. Use our codesigndoc tool to collect the code signing files.

  3. Upload the files to bitrise.io.

    You can do this either on the website UI or with the codesigndoc tool itself.

    Screenshot

  4. Make sure you have the Certificate and profile installer step in your workflow.

  5. Add the Generate cordova build configuration step to your Workflow. It must come after the Certificate and profile installer step.

  6. Fill in the required input for the step. Please note that both the Code Signing Identity and the Provisioning Profile are required inputs for iOS apps even though they are not marked as such.

    Screenshot

    • Build configuration: you can set it to either debug or release.
    • Code Sign Identity: enter a Developer or a Distribution identity.
    • Provisioning Profile: enter the appropriate Provisioning Profile.
    • Packaging Type: this controls what type of build is generated by Xcode. Set the type of code signing you need.
  7. Add the Cordova archive or the Ionic archive step to your workflow.

  8. Fill in the required inputs.

    • The Platform input needs to be set to: device.
    • The Build command configuration input must match the Build configuration input of the Generate cordova build configuration step.

    This step must come after the Generate cordova build configuration step in the workflow.

  9. Run your build!

Ionic/Cordova code signing with auto provisioning

  1. Make sure your .p12 signing certificates are uploaded to bitrise.io.

    If you use codesigndoc to collect the files, note that you can tell the tool to export only the certificates, by calling:

    codesigndoc scan --certs-only xcode

    codesigndoc can also upload the files to the website, or you can do that manually.

  2. Add the Cordova prepare or the Ionic prepare step to your Workflow. These steps call the platform rm and platform add commands.

  3. Add the iOS Auto Provision step to your workflow. Please make sure it's the latest version!

    The step will export:

    • the project's development team
    • the installed codesign identity's name
    • the installed provisioning profile.

    These will be used by the Generate cordova build configuration step.

    Do not use both code signing steps in your workflow

    If you have both the Certificate and profile installer and the iOS Auto Provisioning steps in your workflow, your build will fail.

  4. Add the Generate cordova build configuration step to your Workflow. Configure the step to use the code signing settings exported by the iOS Auto Prevision step:

    Development distribution example

    - generate-cordova-build-configuration:
        inputs:
        - development_team: $BITRISE_DEVELOPER_TEAM
        - package_type: development
        - code_sign_identity: $BITRISE_DEVELOPMENT_CODESIGN_IDENTITY
        - provisioning_profile: $BITRISE_DEVELOPMENT_PROFILE
        - configuration: debug

    Production distribution example

    - generate-cordova-build-configuration:
        inputs:
        - development_team: $BITRISE_DEVELOPER_TEAM
        - package_type: app-store
        - code_sign_identity: $BITRISE_PRODUCTION_CODESIGN_IDENTITY
        - provisioning_profile: $BITRISE_PRODUCTION_PROFILE
        - configuration: release
  5. Add the Cordova Archive or the Ionic Archive step to your workflow.

  6. Fill in the required inputs.

    • The Platform input needs to be set to: device.
    • The Build command configuration input must match the Build configuration input of the Generate cordova build configuration step.

    Screenshot

  7. Set the Should remove platforms as prepare step? to false. This is crucial: it ensures the step will not remove and re-add the platform of the native projects generated in the Cordova prepare or the Ionic prepare step.

  8. Run your build!