During the real machine test, I followed the online process and passed the test. At that time, I did not pay attention to the meaning of various certificates. Currently, message pushing requires various certificates and app id information. In order to better understand this process, I sorted out relevant information about certificates and so on. It is convenient for you and friends in need.
Content reference: http://blog.csdn.net/hitwhylz/article/details/22989507
Http://my.oschina.net/u/1245365/blog/196263
When you are about to perform a real machine test or publish an application to the App Store, you must apply for a certificate. (Development -- test the certificate. Distribution -- publish a Certificate)
Go to the certificate management website https://developer.apple.com/account/ios/profile/profilelist.action.
You can easily find such a few things.
Among them, Devices refers to the device. We will not introduce it here. Each developer account can associate with 100 devices. You can directly add your device through xcode.
Now we will focus on Certificate, AppId, and Provisioning Profile.
Certificate (Certificate)
A certificate is a credential that you have the right to develop. It is a developer's identifier, which is equivalent to an ID card. A developer account has only one set. One set includes two types: Development and Distribution (that is, Production ).
Among them, the Development certificate provides the developer's permission to debug the real machine on the computer, and can make multiple copies and distribute them to multiple computers.
The Distribution certificate gives developers the permission to publish ios programs. That is to say, with this certificate, you have the right to publish programs to the App Store. Only one copy can be made and distributed to multiple computers.
The following is the classification information of the certificate: (the certificate is valid in brackets)
- Development
- App Development (1 year): used to develop and debug applications on a real machine.
- Push Development (1 year): Used to debug Apple Push Notification
- Production
Note:
Before applying for a Certificate, we need to apply for a Certificate Signing Request (CSR) file. In this process, a pair of public and private keys are generated and saved in your Mac Keychain. The code signature uses this asymmetric key-based encryption method to sign the Code with the private key and use the public key for verification. As shown in, the related public key and private key are stored in the login of your Mac keychain, and the certificate contains the public key. You can only use the private key for signature, so if you do not have the private key, it means you cannot sign it, so you cannot use this certificate, at this time, you can only apply for one certificate before revoke. Therefore, it is best to export and save your private key after applying for the certificate. When you want to share a certificate with others or other devices, you can pass the private key to it. The private key is stored in your Mac, and the Certificate generated by Apple contains the public key. After you sign the Code with your own private key, Apple can use the public key in the certificate to verify that you signed the Code, rather than impersonating you, it also ensures code integrity.
App ID
The App ID is used to identify one or more apps. The App ID should be consistent with the Bundle ID in Xcode or match. There are two types of App IDs:
- Explicit App ID: Unique App ID. This App ID uniquely identifies an application, such as com. ABC. demo1, and identifies a program whose Bundle ID is com. ABC. demo1.
- Wildcard App ID: a Wildcard App ID used to identify a group of applications. For example, * indicates all applications, and com. ABC. * indicates all applications starting with com. ABC.
Each time an App ID is created, you can set the App Services used by the app id, that is, the additional Services used by the App ID. Each additional service has different requirements. For example, to use Apple Push Notification Services, it must be an explicit it App ID to uniquely identify an application. The following are all optional services and corresponding configuration requirements.
If your App uses any of the above services, you must configure them as required.
Identifiers
The App ID is the unique identifier of the application, and the app id of each application is different.
Provisioning Profile
A Provisioning Profile file contains all the preceding content: Certificate, App ID, and device.
Imagine if we want to package or run an application on a real machine, we first need a certificate to sign the application to identify the application as legal, secure, and complete; then you need to specify its App ID and verify that the Bundle ID is consistent with it. Again, if it is a real machine debugging, you need to confirm whether the device can be used to run the program. The Provisioning Profile package all the information so that we can use it when debugging and releasing programs. In this way, we only need to select different profile files under different circumstances. The Provisioning Profile file will be embedded in the. ipa package during packaging.
For example, as shown in, a Provisioning Profile for Development contains the App ID, available certificates, and devices corresponding to the Provisioning Profile. This means that the Provisioning Profile package must have the corresponding certificate and run the program corresponding to the App ID to the device included in the Devices.
As mentioned above, the process of running an application on a device is as follows:
Like a certificate, Provisioning Profile can be divided into two types: Development and Distribution:
(Note: As mentioned above, different types of certificates can be created for different account types. Obviously, the types of Profile files are related to the types of certificates you can create)
- Development (1 year)
- Distribution (1 year)
- In House
- Ad Hoc
- App Store
The difference between In House and Ad Hoc is that In House has no limit on the number of devices, while Ad Hoc is used for testing, ad Hoc packages can only run on available devices registered in the account. Obviously, there are a maximum of 100 devices. The difference between the two Provisioning Profile files is that the device restrictions are different, and the Certificate files they use are the same.
2. Development/release process
After understanding the above concepts, it is very easy to look at the development and release processes, and I believe that you can complete all the operations step by step without having to look at the tutorials.
Development/real machine debugging process
According to the above introduction, we can see that the following steps are involved in developing:
- Apply for Certificate
- Add Device
- Generate Provisioning Profile
- Set Xcode Code Sign Identifer
In fact, the third step is usually not needed, because we usually use Xcode to generate and manage the iOS Team Provisioning Profile for development, because it is very convenient, therefore, you do not need to manually generate a Provisioning Profile.
IOS Team Provisioning Profile is automatically generated by Xcode when you use Xcode to add devices for the first time. It contains a Wildcard App ID (*, matching all applications) generated by Xcode ), shows all the Devices and Development Certificates in the account. Therefore, all members of the team can use this iOS Team Provisioning Profile to debug all applications on all devices in the team. When a new device is added, Xcode updates the file.
Release Process
I will not describe a lot of online App Store Publishing procedures, but according to the above concepts, whether it is App Store, In-House or Ad-Hoc, the packaging process is similar and involves the following key steps:
- Create a publishing Certificate
- Create App ID
- Create the corresponding Provisioning Profile file
- The device Bundle ID is the same as the App ID.
- Set Xcode Code Sign Identifer, select the appropriate Profile and certificate for signature, and Package
The above is an introduction to certificates, Provisioning Profile, App ID, etc. The next article will introduce the following In-House certificate-related content.
The following describes how to apply for a certificate: Step 1: Apply for a local certificate
To apply for a certificate, you must first apply for a certificate on our computer and find:
Click "Others" and find "key string ":
Select to apply for a certificate from the issuing authority. Note the red box below. You must select the one:
Click to see:
If you select "store to disk", simply enter "User email address" and click "continue ":
"Storage as:" can name the certificate, select a location, and click "Storage ":
In this way, a certificate is generated on the desktop.
Note that this local certificate can be used to generate both the "Development Certificate" and "Publish certificate ".
The following describes how to apply for the "Publish Certificate" and apply for the "develop Certificate" in the same steps.
Step 2: apply for a certificate in the developer account
Go to the $99 Development Account and see:
Click Certificates, Identifiers & Profiles. The page is displayed:
If you want to apply for a Development certificate, select Development. If you want to apply for a certificate, select Production. In this step, select "+" and add the certificate:
Click "+" and you will see:
If you select "Development Certificate", click the first red box
If you select "Publish Certificate", click the second red box
After selecting, click "continue ":
Click to display:
Select "Choose File" to upload the certificate that you just applied to save to your local device:
After uploading the certificate, click "Generate" to Generate the certificate.
Select "Download ".
In this case, the certificate generated locally is useless and can be deleted.
We return to the certificate page to see the certificate we applied:
Generally, it is enough to apply for an IOS Distribution and a Development certificate (IOS Development.
Find the downloaded file, double-click it, and add it to the key string. In this step, if the key string cannot be added, drag it into the key string:
In this way, the certificate application is complete. With the certificate, you can apply for a variety of description files for development and use.