iOS code signing for 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 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. 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.

    Uploading certificates and Provisioning Profiles
  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 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
  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 automatic code signing asset management

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