Guide to generating iOS private key certificates and certificate profile files

When using uniapp to package iOS apps, we are required to provide a private key certificate and a certificate profile file. The private key certificate can be generated using the keychain access program of a Mac computer, or it can be generated using Banana Cloud Compiler. Certificate profile files can be generated directly in the Apple Developer Center.

For some students who are new to iOS development, or those who do not have a Mac computer, generating a certificate is a more difficult problem than development. Therefore, our article will focus on the generation strategy of iOS private key certificate and certificate profile file.

If you do not have a developer account in the Apple Developer Center, you need to follow the following tutorial to register an Apple developer account first: https://blog.csdn.net/handsome0916/article/details/130267123

After you have an Apple developer account, you can use the following tutorial to create the p12 private key certificate and certificate profile file:

The method to generate a p12 private key certificate is as follows:

1. Log in to the Apple Developer Center, click the certificates menu, enter the cer certificate management page, and click the blue plus sign on the right to start creating a certificate in cer format.

 

When creating a cer certificate, you must choose the ios distribution ad hoc and app store type certificate. Do not choose other types, especially the apple type or dev type certificate. Many people choose the wrong type here because ios development You cannot choose the apple type.

Then click Next, the following interface will appear, asking us to upload a csr file.

 

This csr file requires us to create it on a mac computer. What should we do if we don’t have a mac computer? You can use Banana Cloud Editor to create this csr file in the next step.

2. Log in to Banana Cloud Editor: https://www.yunedit.com/createcert

Enter the backend of Banana Cloud Editor to create a certificate, as shown below, click to create a new csr file

 

After creating the csr file, download the csr file to your computer locally.

3. Return to the Apple Developer Center and continue to upload the csr file to create the cer certificate. Then download this cer certificate to your computer locally.

4. Switch back to Banana Cloud Editor, upload the cer file you just generated in the Apple Developer Center, and then use the generate p12 certificate function to export the p12 certificate.

 

Through the above steps, the p12 certificate has been generated.

We want to use uniapp packaging. In addition to the p12 certificate, we also need a certificate profile file.

Below we introduce the tutorial for generating profile files:

1. Log in to the Apple Developer Center, click the Identifiers menu, and check whether identifiers (we call them AppId) have been created. If they have not been created, create them first.

 

 It should be noted here that when creating, you need to fill in the same package name as you fill in in the development tool, such as this format:

com.xxxxxxxxx.yyyy

2. After creating the appId, you can start creating the profile file, as shown below, click the profiles menu to start creating the profile file:

 

In the process of creating the profile file, he will ask us to select the type. When we create it for the first time, we will not consider testing first. We will first create the app store type for experimentation. Then it will ask us to select the appId and select the Appid just created.

It will then ask us to select a certificate:

 

Don’t select the wrong certificate here. Be sure to select the certificate you just exported to p12. If you select the wrong certificate, the profile file will not match our p12 certificate. 

Through the above two steps, we can generate an app store type description file. However, the app store is a shelf type and cannot be tested on a real device. If we need to create a test package for real device testing, we need to select the ad hoc type in the second step.

If we choose an ad hoc type description file, it will ask us to provide the UDID of the test device. So how to obtain the UDID of the test device? You can scan the QR code to obtain the UDID of the test device through the tool for obtaining UDID above Banana Cloud Editor:

 

Okay, so far, we have learned to generate p12 certificate and certificate profile files.

Guess you like

Origin blog.csdn.net/h5xiaoyu/article/details/131944238