When we start off as an iOS Developer, we all face a common obstacle ,that is generating the certificates and using it in our apps because Apple does not allow us to debug or run our app without Certificate. So we need an Apple Developer Certificates to develop ,debug and run.
In order to know the types and procedure to use it, first we need to have an understanding of code signing and why it is needed. So lets start with it.
Code signing our app is necessary because due to this only users trust that our app has been created by a source known to Apple. All iOS apps must be code signed and provisioned to launch on a device or to be distributed for testing, or to be submitted to the store.
Due to Code signing our app, it allows the OS to identify who signed the app and to verify that our app hasn’t been modified since we signed it.
The development certificate allow us to sign our app and to install it on a device from the computer on which the certificate is installed (associated with provisioning profile).
There are two types of Apple Certificate:
Provisioning Profile is a file included in the Bundle, iOS checks the validity to authorise.
the app to run on a device.
For developer provisioning profile, Apple allows developer to develop and debug it in a particular device (UDID).
For production there are three types of provisioning profile :
- Developer Provisioning Profile: To develop, debug our app in a deivce.
- Distribution Provisioning Profile: that means we can push our app to Apple store.
- Ad-hoc Provisioning Profile: It is same as Development certificate but we can not debug our app. We can use it in a particular device but not be debug it.
Now lets see the procedure to use it in Developer’s end.
- We have to install the certificate in Keychain Access.
- Now in Xcode we can see the certificate (Xcode > Window >Organizer).
- To build the new certificate go to Project > Edit Project Settings. Then go to the Build tab and scroll down to the Code Signing section and select the new certificate for Code Signing Identity.
- Now we can connect our device and Build and Run.
Hope this will help in understanding the concept of certificate and provisioning profile to use in iOS app.