To run apps you’re developing on a device, you must set up the device for development. This process involves these main tasks, which you do in Xcode:
-
Obtaining a developer certificate that allows you to sign apps.
-
Obtaining a provisioning profile that identifies your developer certificate, your device, and the applications you can run on the device.
-
Certificate request. A certificate request (also known as a certificate signing request, or CSR) contains personal information used to generate your development certificate.
-
Development certificate. A development certificate identifies you as an app developer. When it’s stored in your keychain, it includes your private key. In your development team’s signing assets and in your provisioning profile, it includes only your public key.
When Xcode builds your app for installation on a device, it looks for your developer certificate in your keychain. If it finds the certificate, Xcode signs your app. Otherwise, it reports a build error.
-
Provisioning profile. A provisioning profile associates one or more developer certificates and one or more devices with an app ID.
![](https://img-my.csdn.net/uploads/201208/10/1344567867_4281.png)
To distribute apps you need a distribution certificate and an distribution provisioning profile:
-
Distribution certificate. A distribution certificate identifies your development team. When it’s stored in your keychain, it includes the team’s private key. In your team’s signing assets and in a distribution provisioning profile the distribution certificate includes only the team’s public key.
-
Distribution provisioning profile. A distribution provisioning profile includes your team’s distribution certificate and an app ID. If the provisioning profile is for user-testing (also known as an ad hoc hoc distribution profile), it identifies the devices on which testers can run the app identified by the app ID.