How to Code Sign Your iOS and iPadOS Apps Before Publishing on App Store

iOS iPad App Code Signing

App developers who build apps for Apple’s iOS and iPadOS need to code-sign their applications before publishing them on the App Store. Code signing is the process of validating the identity of app developers or publishers to affirm that the code is coming from a genuine source.

Code signing for Apple devices is a little different than for other platforms. While apps for other platforms are validated by third-party Certificate Authorities (CA) like Sectigo or Comodo, here, Apple acts as a CA to validate the developer’s identity.

Apple Mac OS Code Signing Certificate Starts at $199.99/yr

In this article, we will explore the code signing process for iOS and iPadOS applications and what things to keep in mind while code signing. But before we get into that, let’s understand why you should sign your iOS apps and what are the prerequisites for doing so.

Why Code Sign Your iOS Apps?

The first and simplest reason is that Apple requires it from everyone. The Cupertino giant has made it mandatory for developers to code sign their apps before they can publish them on the Apple App Store.

Another reason for code signing your iOS apps is it makes users feel safe when using your apps. The Apple team requires each developer to go through an extensive validation and authorization process before they can publish their apps. This ensures that only trusted developers can publish their apps and no code modifications can be done after signing.

Further, code signing your apps also makes sure that nothing changes after the developers sign their apps. In a nutshell, code signing your iOS and iPadOS apps make them safe for users.

Prerequisite for Code Signing iOS and iPadOS Apps

  • A macOS device to code sign your apps
  • App ID
  • Device UDIDs

The first and foremost requirement is you need to have a macOS device and prepare it for the code signing of your applications. First, you need to install Xcode and then PowerShell on your macOS. Then enroll for the Apple Developer Program membership to generate a code signing certificate for iOS apps.

This is a paid membership and can cost you around $99/year to access the Apple developer ecosystem. This membership enables you to generate three different types of certificates: Development, Distribution, and Enterprise certificate.

Since you want to publish apps on the App Store, you’ll need a distribution certificate. If you want to distribute apps within your enterprise, you’ll need to sign up for Apple Enterprise Developer Program. In any case, let’s see how you can create an App ID for code signing:

How to Create an App ID for Code Signing

Follow the below process to generate the App ID for code signing your iOS and iPadOS apps:

  • Log in to your Apple developer account and click on the Account tab from the top navigation panel.
  • From there navigate to Certificates, IDs & Profile > Identifiers
  • Click on the (+) icon beside Identifiers to create a new ID
  • Click on the round icon beside App IDs and then click on the Continue button.
  • You’ll be asked to select the type. Click on App and then click on Continue again.
  • On the next page, register the App ID.
  • You’ll be asked to enter details such as Description, Bundle ID, and others.
  • Next, enable the Associated Domains, NFC Tag Reading, iCloud, and Push Notification capabilities and then click on Continue.
  • Review all the details you have entered. If everything checks out, create the App ID.

iOS and iPadOS App Code Signing Process

Obtaining a code signing certificate process for iOS and iPadOS devices starts with generating a new signing request. Let’s see how you can do so:

Generate a Code Signing Request (CSR)

To generate a CSR, you’ll need to:

  • Open your mac device
  • Open Keychain Access from Applications > Utilities.
  • Click on the Keychain Access and find the option Certificate Assistant > Request a Certificate from a Certificate Authority.

On the next page, you’ll be asked to fill out the Certificate Information as described below:

  • Enter your Apple email ID as the User Email Address to identify with the certificate.
  • Enter your name in the Common Name
  • Select the Saved to Disk option in the request group
  • Save the CSR file to your mac device.

Generate the Code Signing Certificate for App Distribution

Follow the steps provided below to generate a code signing certificate for app distribution:

  • Log in to your Apple developer account
  • Open Certificates, IDs & Profiles > Certificates
  • Click on the (+) icon to generate a new certificate
  • Next, click on the App Store and Ad Hoc and then click on Continue
  • Upload the CSR file saved on your Mac device
  • Click on the Continue button and download the certificate on your device.
  • Open the downloaded .cer file to install it on the Keychain Access
  • Note down the Name of the certificate as this will be the code signing identity that needs to be provided for signing.

Create Provisioning Profile

An iOS Provisioning Profile is required for developers when they want to publish an app to the Apple App Store. Here’s how you can create one:

  • From Certificates, IDs & Profiles, open the Profiles tab.
  • Click on the (+) icon and select the Ad Hoc option in the Distribution section, and click on Continue.
  • Next, select the App ID we created earlier and then click on Continue.
  • Now, select the certificate we created in the earlier step to continue.
  • Select the test devices to install the app on
  • Now enter the Provisional Profile Name that can easily be identified in the Apple Developer Portal.
  • Click on the Generate button and then download the profile to your device.
  • Open the file and register it with Xcode.

Certificate Installation and App Publishing Process

Now that all the steps for code signing certificate generation are complete, let’s get to the certificate installation and app publishing process.

Xcode Code Signing Configuration

First step is to configure your Xcode for code signing. Here’s how you can do so:

  • Open Xcode on your Mac device and open Signing and Capabilities from the root project directory.
  • You can either select Automatically manage signing or manual signing.
  • In Automatic, you just need to select the team from the list.
  • In manual code signing, you need to upload the Provisioning Profile.

Create App Profile

App Profile is necessary for uploading your app from Xcode to Apple App Store.

  • To create an app profile, log in to the App Store Connect portal and open the My Apps page.
  • Click on the (+) icon to add a new app and fill out the details.
  • Once done, you can add the information required to publish the app.

App Upload Using Xcode

You can upload the .ipa app file to App Store Connect using the Xcode once the above steps are complete. Here’s the process to do so:

  • Select the target device list as Generic iOS devices in the Xcode
  • Navigate to Product > Archive and select the latest build that you want to upload to App Store Connect.
  • Then click on the Distribute App button.
  • On the next page, select App Store Connect and click on the Next button.
  • Again click Next to open a page to select the Distribution Certificate and App Name.
  • Verify the data and click on the Upload button.

Congrats! Your app is now successfully uploaded on the App Store Connect. Let’s see the last step of app publishing.

Publishing App on Apple App Store

Here are the steps to publish your code signed app on Apple App Store:

  • From the App Store Connect portal, go to App Information and open the Privacy Policy URL. From there, enter Age Rating and Category details.
  • Set the price of the app from Pricing and Availability.
  • Next, click on the Prepare for Submission option to upload screenshots of apps and other details.
  • Select your app’s build version to publish.
  • Submit the app for review.

Final Conclusion

We hope that you have found this iOS app code signing guide helpful to get started with your app publishing process. Remember that obtaining a code signing certificate to upload your app on the App Store Connect portal is mandatory.

Code signing your iOS and iPadOS apps ensure that the piece of code has not been modified since signed. Also, it makes sure that the app is coming from a specific source that is a trusted developer and determines the trustworthiness of the code.

The iOS app signing process is simple as described above. However, if you still need help, SignMyCode.com has a team of code signing experts to help you with your iOS app code signing. Contact us to consult with our code signing experts for all your iOS app code signing needs.

Janki Mehta

Janki Mehta is a Cyber-Security Enthusiast who constantly updates herself with new advancements in the Web/Cyber Security niche. Along with theoretical knowledge, she also implements her practical expertise in day-to-day tasks and helps others to protect themselves from threats.