All iOS apps and most Mac apps must be code signed and provisioned to launch on a device.
Provisioning is the process of preparing and configuring an app to launch on devices and use app services.
It takes just a few steps to launch your app on a device:
1) First you need to enroll for the iOS Developer Program
To do so, open a browser and go to
iOS Dev Center, Sign in with Apple developer account and click on
Learn More in the iOS Developer program section on the top right.
On the next page, click the
Enroll Now button and follow the steps to complete the enrollment.
Note: It can take several days for your application to be accepted. Apple
manually approves each application, which means that you won't have
access to the iOS Developer Program until you get the green light from
Apple.
2) Create Certificate Signing Request
After enrolling for the iOS Developer Program, you can see
Certificates, Identifier & Profiles,
iTunes Connect,
Apple Developer Forums, and
Developer Support Center.
Click on the
Certificates, Identifier & Profiles section on the right
The provisioning process starts with the creation of an
iOS Development Certificate.
A certificate is an electronic document that links your digital
identity with other information, such as your name, email, and company
information.
A development certificate consists of a secret
private key and a shared public key
Xcode uses the private key of
the certificate to cryptographically sign your application binary. To
obtain a development certificate, we first need to create a
certificate signing request or
CSR.
You can create a CSR using OS X's
Keychain Access utility, Open the
Keychain Access menu, select
Certificate Assistant and choose the option labeled
Request a Certificate From a Certificate Authority.
Fill out the Form by entering your email address and name with which you
sign up for your Apple Developer account. Leave CA Email field, make sure to select the option
Saved to disk to save the certificate signing request to your system.
Click on Continue, specify a location to save CSR and click Save.
In Keychain Access, under the
Keys category, you can see that the private and public keys have been added to your login keychain.
3) Create Developer Certificate
Go back to Apple Dev Center, and click
Certificates, Identifiers & Profiles
Now select Certificate.
From the Top right click on " +" button
after that you can see a new page
Select Certificate type and click on Continue
The next view tells you how to create a CSR. Feel free to click
Continue since we already have a CSR ready to upload.
Upload CSR file and Click on Generate.
Click the
Download button to download the certificate to your development machine.
Locate the certificate on your development certificate and double-click it to add it to your login keychain.
Repeat step 2 and 3 for Distribution Certificate.
4) Add Device
You cannot run an iOS application on a random device. You need to
specify on which devices your iOS application should run by adding one
or more iOS devices to the iOS Dev Center.
Browse to the
Certificates, Identifiers & Profiles section of the
iOS Dev Center, click the
Devices tab in the
iOS Apps
section, and click the plus button in the top right. To register a
device, enter a name for the device and he device's UDID. The UDID is an
identifier that uniquely identifies an iOS device. Note that the UDID
is not the same as the device's serial number.
5)Create An Apple ID
An app ID is an identifier that uniquely identifies an application on iOS.
The app ID of an application consists of your
application's bundle identifier prefixed with a
unique 10 character bundle seed ID generated by Apple.
By default, the bundle identifier is your application's name prefixed
with your project's company identifier. You can change the bundle
identifier to whatever you like.
To create a new app ID in the iOS Dev Center, navigate to the
Certificates, Identifiers & Profiles section, click
iOS Apps, and choose
App IDs from the menu on the left. To create a new app ID, click the plus button in the top right.
Give your App ID Description and Bundle ID .
Make sure you enter it in the section labeled
Explicit App ID.
Click on Continue Button.
6) Create a Provisioning Profile
"A provisioning profile is a collection of assets that uniquely ties
developers and devices to an authorized iOS Development Team and enables
a device to be used for testing." In other words, a provisioning
profile contains the information that the operating system needs to
verify whether an application is permitted to run on a specific device.
This implies that the provisioning profile needs to be installed on each
device the application needs to run on."
In the
Certificates, Identifiers & Profiles section of the
iOS Dev Center, select the
Provisioning Profiles tab in the
iOS Apps section. Click the plus button in the top right to create a new provisioning profile. Select
iOS App Development in the section labeled
Development and click
Continue.
In the next step, select the app ID you created
Select the development certificate from the list of certificates to
associate the new provisioning profile with the correct certificate and
click Continue.
Than, select the devices you wish to link to the provisioning profile.
Remember that only these devices will be able to run your application
during development.
Give the provisioning profile a descriptive name, Click on Generate,
Download provision profile and double tap to install that.
Repeat Step 6 for creating new provisioning profile for "Ad Hoc" and "App Store".
7) Configuring the Project
Open the Xcode project and select the project from the Project Navigator on the left. Select the first item in the list of targets and click the tab labeled Build Settings at the top.
Search for the section titled Code Signing
Browse provisioning profile
for Debug select Development provisioning profile
and for Release select Ad Hoc provisioning profile
In Code Signing Identity
select Developer Certificate for Debug and Distribution Certificate for Release.
8) Create IPA File
Select XCode , from Menu select clean under "Product" Option.
after successful cleanup select Archive under "Product" Option.
after success, you can see another window
Click on Export, select or add developer account and specify location for save file.
you can find IPA file on specify location.