Use of the iOS Development Certificate and configuration file, and the ios certificate configuration file
Prerequisites
As we all know, to develop iOS applications, you must have an iOS certificate and Provisioning Profiles:
1. What is an iOS certificate and how is it associated with an app?
2. What is the difference between iOS development certificate and production certificate? How can I use it?
3. What is the relationship between certificates and Provisioning Profiles? How can I use the configuration file in Xcode?
4. How can I apply for a certificate and configuration file?
5. What is Key Pair (Public Key/private Key )? How is the certificate associated?
6. What is the role of signature?
Preparations
If you want iOS development, you must first meet the following conditions:
1. First, you must have an Apple Developer Account)
- Only a developer account can apply for a development/release certificate and corresponding configuration file.
- Developer accounts are divided into two types: Individual (personal or Company developer account $99) and Company/Organization (Enterprise developer account $299.
2. to debug a real machine, you must have at least one Mac development machine (iMac or MacBook) with Mac OS X/Xcode installed)
1. log on to the iOS Dev Center
If you already have an apple developer account, log on directly.Apple Developer CenterApply for a development certificate.
- Logon page
F323D07E-B16C-43D6-AF31-7B681C9EFCA7.png
- Select "Certificates, Identifiers & Profiles". The following page is displayed. any item in the iOS Apps column is selected.
EB52CB59-2C2C-4DB8-8F4E-F9F3F1BB28FB.png
5F9C1BE5-46DB-4023-AD0E-1F717AEB80AE.png
The four items are described below.
2. Certificates (certificate), Identifiers (identifier), Devices (device), Provisioning Profiles (supply configuration files)
In order to facilitate understanding, we disrupt the order and introduce these four items respectively.
2.1. Identifiers
Identifiers are Identifiers, which are equivalent to ID cards. They are used to create the following three IDs:
App IDs
Pass Type IDs
Website Push IDs
2.1.1. About App IDs
The App ID is the unique identifier of the application:
- The App ID and Bundle Identifier in Xcode are consistent (Explicit) or matched (Wildcard.
FEDE676C-1DFC-4958-B52E-3B2DF73A35B3.png
- The App ID string generally uses Company Identifier (Company ID) in the reverse-domain-name format as the Prefix (Prefix/Seed) and generally contains no more than 255 ASCII characters.
- You can Register (Register) or Delete (Delete) registered App IDs on the Developer MemberCenter website.
2.1.2. Create an App ID
- Select "App IDs" in the "Identifiers" column to view all applied App IDs and click "+" in the upper right corner"
1EF8FB56-E265-4B97-A8BE-327841B86814.png
- Go to the Register iOS App ID page and enter the Name in the "Name" Field of "App ID Description ".
72E71207-FB31-4BC6-8E03-7EDADE9A82EC.png
- Enter the App ID (Anti-Domain Name format, such as com. company. test) in the Bundle ID field in the "Explicit App ID" column)
- Here, "Bundle ID" corresponds to "Bundle identifier" in Xcode"
- Explicit App ID: Unique App ID, used to uniquely identify an application. For example, the App ID "com. apple. garageband" is used to identify the App whose Bundle Identifier is "com. apple. garageband.
- Wildcard App ID: the App ID that contains wildcards to identify a group of applications. For example,"(Actually Application Identifier Prefix) indicates all applications; while" com. apple.It can indicate all applications of Bundle Identifier starting with "com. apple.
Export ccec6-8b91-4cd8-ad2d-027a49b8aa02.png
- In the "App Services" column, select the service to be used by the application. (to use the Push function, select "Push Notifications ")
423D58C6-2535-4726-98C6-500658BD1141.png
- Click continue-> submit-> done to apply for App IDs. Click All IDs to view the applied ID. Click this ID.
453733A7-ABE7-4696-95EE-45168BD75172.png
- Click "Edit" to Edit the App ID.
2.2. Certificates2.2.1. description
The iOS certificate is a digital certificate used to prove the legitimacy and integrity of the iOS App content (executable code. For applications (Apps) that want to be installed on a real machine or published to an AppStore, only Signature Validated can ensure that the source is trusted, it also ensures that the App content is complete and not tampered.
- A digital certificate is a file digitally signed by the certificate authorization center that contains information about the public key owner and the public key. It is time-sensitive and valid only for a specific period of time.
- There are two types of iOS certificates:Development Certificate)AndProduction certificate).
2.2.2. Generate the certificate request file (CSR)
You can request a certificate from the certificate authority through the Keychain certificate assistant. When adding a certificate (Certificates) to the iOS Dev Center, you need to upload and modify the CSR file.
- Open the Keychain and click "access key"-> "Certificate assistant"-> "request certificate from the Certificate Authority" in the menu bar"
64A49729-3C03-4F8F-9910-3E9688235B86.png
- Enter the Development Account email and common name, and select "store to disk ".
096ED51F-A832-4DA5-BBB0-FEBA17BE4764.png
- After you continue and select the storage location, the Keychain will generate a CSR (Certificate Signing Request) file containing the developer's identity information. In addition, a Pair of Public/Private Key Pair is added to the Keychain Access-> Keys (Key.
DAB324D4-D886-4097-A54D-1E37038A87A1.png
2.2.3. Apply for a certificate
- Go to the iOS Dev Center, "Certificate"-> "All", and click "+" in the upper right corner (you can also directly click "Development" or "Production" under "Certificate ", directly select to apply for a development certificate or produce a certificate) To Go To The following interface:
F5FABF55-157A-47BB-B3A3-3A0125ABAFDC.png
- Select development certificate or production certificate. Here, the production certificate is used as an example to continue
DB782EBE-01C6-48A1-A83E-A6B6CAC5D349.png
- Select the App ID, that is, the App ID we created in "Identifiers ".
62F40B5F-4FA9-49C3-B707-46EADD3EC28A.png
- This section describes how to generate a certificate request file, that is, the. certSigningRequest file generated in "2.2.2. Generate a certificate request file (CSR )".
1A7B633E-B61B-4E63-8EEB-B0D15D0B053E.png
- Here you need to add the generated certificate request File (CSR), "Choose File" select the generated. in the certSigningRequest file, click "Generate" to apply for a development certificate. The process for applying for a production certificate is similar.
9D2FC3A0-7FC7-43A9-8C3D-B60F108528ED.png
- You can click "Download" to Download the development certificate, or view the Certificate in "Certificates"-> "All" and Download or delete it,
A9690706-6620-4A3D-9B9A-D727EFFC9179.png
- Download the certificate and double-click Import Keychain Access. You can view it in Keychain Access> Certificate
Screen snapshot 255.5.4020.6.png
- Expand the arrow above the Installed Certificate (ios_development.cer) to view the corresponding private key. In KeychainAccess-> "Key", the arrow in front of the private Key in the Key Pair generated when the CSR is created. You can view the certificate containing the corresponding public Key.
2.2.4. Export Certificate
- Open Keychain Access, select a successfully installed certificate, right-click and choose Export"
1EF53825-B4C4-43B6-A0D8-536FE32AEB81.png
- Enter the name. The default format is. p12. Select "Save"
72BA1D21-C005-4A7B-81B6-3B8ADC62872D.png
- Set the password and click "OK"
47AF6037-0C4F-4960-9AD8-75C5EE34CA6F.png2.3. Devices
2.3.1. Add debugging devices
- Go to the iOS Dev Center and select "All" under "Devices" to view All added Devices. Click "+" in the upper right corner to add new debugging Devices.
9A9CA0B2-F320-4F9F-B51A-B0C250FECC63.png
- Enter "Name" and UDID (which can be viewed in xcode or iTunes ).
ADF3D2DB-09B6-42D2-899B-D92D0E6163B5.png
- After confirming the information, click Register to complete adding.
2.3. Provisioning Profiles2.3.1 Concept
The Provisioning Profile file contains all the above content:Certificate,App ID,DeviceAnd the suffix is. mobileprovision.
3DAD606D-8BDC-4A7E-8644-5A7CF27DF3B4.png2.3.2. Create a configuration file
- Open iOS Dev Center, "Provisioning Profiles"-> "All", and click "+" in the upper right corner (you can also click "Development" or "Production ")
AC661BDE-DE94-487E-9A71-4C436224CB5D.png
- Select develop or release the certificate configuration file. Here, the Development is used as an example. Click iOS App Development to continue.
0ab45e72-821d-4f5c-84f8-440e97cc565.png
- Select the corresponding App ID and continue
F0C2D519-CA90-4286-A0AB-3A42DB4EADA0.png
- Select the certificate to be associated.
50725524-699D-400B-B1C0-3C5024774F95.png
- Select the device for debugging and installation (up to 100 devices ),This page is not displayed if it is a production certificate configuration file (production certificate is used for publishing and cannot be developed or debugged), Continue to see the following interface
3FD54433-014F-4861-803F-994FFACCC910.png
- Enter the file name and click "Generate". The configuration file is created successfully.
56c9b53b-666e-4403-8083-d1857eb58cd4.png
- You can click "Download" to Download the configuration file, or go to "Provisioning Profiles"-> "All" to view All the configuration files and Download or delete them.
6F158A64-B819-476F-86EC-A4BA6EF1E3D2.png
- Download to the local Provisioning Profile and double-click it to automatically install it in xcode. You can see this option in XcodeTarget-> Build Settings-> Code Signing-> Provisioning Profile.
F5A42FB8-44EB-4A5C-B53C-3F3499CF883D.png
- Select this configuration file. The associated Certificate file is displayed by default in "Code Signing Identity" (that is, when this configuration file is created, you can select multiple associated certificates)
3E6BFDF4-28E2-49DF-A31E-0FF507A1604F.png
- The production certificate configuration file is similar.