# 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`.
1. Upload the files to [bitrise.io](https://www.bitrise.io): open the **Project settings** page and select **Code signing** on the left. Upload a certificate and a provisioning profile.
1. Make sure you have the **Certificate and profile installer** Step in your Workflow.
1. Add the **Generate cordova build configuration** Step to your Workflow. It must come after the **Certificate and profile installer** Step.
1. 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.
1. Add the **Cordova archive** or the **Ionic archive** Step to your Workflow.
1. 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.
1. 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](https://www.bitrise.io).
1. Add the **Cordova prepare** or the **Ionic prepare** Step to your Workflow. These Steps call the `platform rm` and `platform add` commands.
1. Add the **[Manage iOS Code Signing](https://www.bitrise.io/integrations/steps/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.

   :::caution[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.

   :::
1. Select the **Apple service connection method** (based on the [Apple service you have set up in Bitrise](/bitrise-platform/integrations/apple-services-connection/about-connecting-to-apple-services)) and the **Distribution method**.
1. Add the **Generate cordova build configuration** Step to your Workflow.
1. Configure the Step to use the code signing settings exported by the **Manage iOS Code Signing** Step:

   **Development distribution example**:

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

   **Production distribution example**:

   ```yaml
   - generate-cordova-build-configuration:
       inputs:
       - development_team: $BITRISE_DEVELOPER_TEAM 
       - package_type: app-store 
       - code_sign_identity: iPhone Developer
       - configuration: release
   ```
1. Add the **Cordova Archive** or the **Ionic Archive** Step to your Workflow.
1. 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.
1. Run your build!
