Skip to main content

iOS code signing for Ionic and Cordova projects

Abstract

Bitrise supports both manual and automatic provisioning for the iOS code signing of Ionic and Cordova apps as well.

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 code signing asset management

  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. Upload the files to bitrise.io.

    Uploading certificates and Provisioning Profiles
  3. Make sure you have the Certificate and profile installer Step in your Workflow.

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

  5. Fill in the required inputs 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.

    • 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.

      Code signing with Ionic and Cordova projects
  6. Add the Cordova archive or the Ionic archive step to your workflow.

  7. 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.

  8. Run your build!

Ionic/Cordova code signing with automatic code signing asset management

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

  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 Manage iOS Code Signing Step to your Workflow. If you have both the Certificate and Profile Installer and the Manage iOS Code Signing Steps in your Workflow, your build might encounter unexpected issues.

    The Step will export:

    • The project’s development team.

    • The installed codesign identity’s name.

    • The installed provisioning profile.

    One code signing Step only

    If you have both the Certificate and profile installer and the Manage iOS Code Signing Steps in your Workflow, your build might encounter unexpected issues.

  4. Select the Apple service connection method (based on the Apple service you have set up in Bitrise) and the Distribution method.

    manageioscodesigning.png
  5. Add the Generate cordova build configuration Step to your Workflow.

  6. Configure the Step to use the code signing settings exported by the Manage iOS Code Signing Step:

    Development distribution example:

    - generate-cordova-build-configuration:
        inputs:
        - development_team: $BITRISE_DEVELOPER_TEAM 
        - package_type: development 
        - code_sign_identity: iPhone Developer
        - configuration: debug
    

    Production distribution example:

    - generate-cordova-build-configuration:
        inputs:
        - development_team: $BITRISE_DEVELOPER_TEAM 
        - package_type: app-store 
        - code_sign_identity: iPhone Developer
        - configuration: release
    
  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.

      Code signing with Ionic and Cordova projects
  9. 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.

  10. Run your build!