How to Code Sign Your iOS and iPadOS Apps Before Publishing on App Store
App developers who build apps for Apple’s iOS and iPadOS must code-sign their applications before publishing them on the App Store. Code signing is 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, Certera, DigiCert or Comodo, Apple acts as a CA to validate the developer’s identity.
iOS/Mac Code Signing Certificate
Code signing your iOS and iPadOS apps ensures that the code has not been modified since it was signed with digital signature.
In this article, we will explore the code signing process for iOS and iPadOS applications and what to remember while code signing. But before we get into that, let’s understand why you should sign up for your iOS apps and what the prerequisites are 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 that it makes users feel safe when using them. The Apple team requires each developer to undergo an extensive validation and authorization process before publishing 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 ensures nothing changes after the developers sign them. In a nutshell, code-signing your iOS and iPadOS apps makes 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 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 paid membership can cost you around $99/year to access the Apple developer ecosystem. This membership enables you to generate three types of certificates: Development, Distribution, and Enterprise.
You’ll need a distribution certificate since you want to publish apps on the App Store. If you want to distribute apps within your enterprise, you must 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 click 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 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 click 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, which can be easily 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 code signing certificate generation steps 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 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 the 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
Once the above steps are complete, you can upload the .ipa app file to App Store Connect using the Xcode. 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 app price 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 you have found this iOS app code signing guide helpful in starting your app publishing process. Obtaining a code signing certificate to upload your app on the App Store Connect portal is mandatory.
Cheap Code Signing Certificates
Prevent Code Tampering and Authenticate Code Integrity by Digitally Sign your Code with Trusted Code Signing Certificates.
Starting at Just $215.99/Year