Transferred from: http://www.cnblogs.com/cywin888/p/3263027.html
Just contact with the development of the iOS people will inevitably have a variety of Apple certificates, configuration files and so on, you may follow the online tutorial steps to successfully apply for the real machine debugging, but still the reason for smattering. This article on certificate, Provisioning profile and so on to do a summary.
1. Concept Introduction
If you have a developer account, open certificates, Indentifiers & Profiles in iOS Dev center and you'll see the following list:
Profile portal has been revised for some time, the structure of the revision is clearer and easier to understand and manage than before.
The list above contains everything you need to develop, debug, and publish iOS apps: Certificates, Identifiers, Devices, Provisioning Profiles. Here are a few things to explain.
Certificate
A certificate is used to sign an application, and only a signed application can guarantee that his source is trustworthy, and that the code is complete and unmodified. In the code Signing identity of Xcode Build setting, you can set up a certificate for signing code.
As we all know, before we apply for a certificate, we need to apply for a certificate Signing request (CSR) file, and this process actually generates a pair of public and private keys, saved in the keychain of your Mac. Code signing is using this encryption method based on asymmetric secret key, signing with the private key, validating with public key. As shown, the associated public key and private key are stored in the login of your Mac's keychain, and the certificate contains the public key. You can only use the private key to sign, so if you do not have a private key, it means that you can not be signed, so you can not use the certificate, at this time you only revoke the previous certificate to apply for one. Therefore, it is a good idea to export and save your private key when you are finished applying for the certificate. When you want to share a certificate with other people or other devices, pass the private key to it. The private key is saved in your Mac, and the Apple-generated certificate contains the public key. When you sign your code with your private key, Apple can use the public key in the certificate to verify that you signed the code, not someone impersonating you, but also ensuring the integrity of the code.
Certificates are divided into two main categories: development and Production,development certificates for developing and debugging applications, production primarily for distributing applications (depending on the type of certificate), The following is the classification information for the certificate: (the certificate validity period is in parentheses)
(Note: Different types of certificates can be created for various developer accounts, please see my other article for a comparison of the developer account and Inhouse certificate related content)
- Development
- App development (1 years): Used to develop and debug applications on the real machine.
- Push Development (1 years): Used to debug Apple Push Notification
- Production
There are some types of certificates I have not used, so I do not understand the specific role.
APP ID
The APP ID is used to identify one or a set of App,app IDs that should be consistent or matched to the bundle IDs in Xcode. The APP ID has the following two main types:
- Explicit App ID: A unique app ID that uniquely identifies an application, such as COM. ABC.DEMO1, identifies the program with bundle ID com.ABC.demo1.
- Wildcard App ID: A wildcard app ID that identifies a group of applications. For example * can represent all applications, while COM. Abc.* can be expressed as COM. All applications that start with ABC.
Each time you create an app ID, we can set up the app services that the app ID uses, which is the extra service it uses. Each additional service has different requirements, for example, if you want to use Apple Push Notification Services, you must be a explicit app ID so that you can uniquely identify an application. The following are all currently optional services and the corresponding configuration requirements.
If your app uses any of the above-mentioned service, it needs to be configured as required.
Device
Device is the simplest, the iOS device. The devices contains all the devices available for development and testing in this account. Each device uses UDID to uniquely identify it.
The number of devices in each account is limited to 100. Disable a device will not increase the number of places, only the beginning of membership year to remove the equipment to increase the quota.
For a question about the number of devices, see this article.
Provisioning profile
A provisioning profile contains all of the above: certificates, App IDs, devices.
Imagine that if we were to pack or run an application on a real machine, we would first need a certificate to sign it to identify the application as legitimate, secure, complete, and so on, and then need to indicate its app ID and verify that the bundle ID is consistent; You need to confirm that the device can be used to run the program. and provisioning Profile packs all this information together so that we can use it when debugging and releasing the program, so we just choose different profiles for different situations. And this provisioning profile file is embedded in the. IPA package when it is packaged.
For example, as shown in, a provisioning profile for development contains the app ID for that provisioning profile, the certificates and devices that can be used. This means that using this provisioning profile wrapper must have the appropriate certificate and that the program that corresponds to the app ID be run to the device contained in devices.
As mentioned above, the process of running an application on a single device is as follows:
As with certificates, Provisioning profile is divided into development and distribution two types:
(Note: The types of certificates that can be created by different account types are different, obviously the type of profile is related to the kind of certificate you can create)
- Development (1 years)
- Distribution (1 years)
- In house
- Ad Hoc
- APP Store
The difference between House and ad hoc is that there is no limit on the number of devices, and ad hoc is used for testing purposes, and ad hoc packages can only run on the available devices that are registered in the account, apparently with a limit of up to 100 devices. So the difference between the two provisioning profiles is that the device limitations are different, and the certificate they use is the same.
2. Development/Release Process
Understanding the above concepts, and then look at the development and release process is very simple, and I believe that you do not have to see the tutorial can be done in one step to complete all the operations.
Development/real-machine commissioning process
According to the above introduction, we can know that the following steps are mainly development:
- Request a Certificate
- Join the device
- Generate Provisioning Profile
- Set up Xcode Code sign Identifer
In fact, the third step is usually unnecessary because we are usually developing with the iOS Team Provisioning profile generated and managed by Xcode because it is very convenient, so you do not need to manually generate the Provisioning profile yourself.
IOS Team Provisioning profile is the first time you add a device using Xcode, Xcode automatically generates a wildcard App ID (*, matching all applications) generated by Xcode. The account contains all the devices and all development certificates as shown. As a result, all members of the team can use this iOS Team Provisioning profile to debug all applications on all the devices in the team. And when a new device is added, Xcode updates the file.
Release process
There are a lot of processes on the web to publish the App Store, and I won't go into it, but according to the concept above, whether it's the app store, in-house or AD-HOC, the packaging process is similar, and includes the following key steps:
- Create a publishing certificate
- Create App ID
- Create a corresponding provisioning profile
- Device bundle ID and app ID match
- Set up Xcode Code sign identifer, select the appropriate profile and certificate for signing, packaging
< > About certificate, Provisioning profile, App ID and the relationship between them