Certificate is an essential element to submit or test an application on iPhone. It comes with code sign(Signatures) which would verified when an application is submitted on apple store or when tested on iPhone.
One can bypass these if an application is installed on jail-break iPhone or when submitted on Cydia but this is not possible when one wants submit it to AppStore.
One has to through 2 step procedure to create a certificate from developer portal. I copied those two from “iPhone developer portal”
- Generating Certificate Signing Request
- Submitting a Certificate Signing Request for Approval
Generating a Certificate Signing Request:
- Open the Utilities folder and launch Key chain Access from the Applications folder.
- Set the value of Online Certificate Status Protocol (OCSP) and Certificate Revocation List (CRL) to “off” in the Preferences Menu.
- Select Key chain Access -> Certificate Assistant -> Request a Certificate from a Certificate Authority.
- Fill in your email address in User Email Address Field. Confirm that this email address is same as provided at the time of registering as iPhone developer.
- Fill in your name in the Common Name field. Confirm that this name is same as provided at the time of registering as iPhone developer.
- It is not necessary to have an Certificate Authority (CA). The ‘Required’ message would be eliminated after finishing the following step.
- Click the ‘save to disk’ radio button if prompted, choose ‘Let me specify key pair information’ and proceed.
- If you choose ‘Let me specify key pair’ option then one has provide a file name and click ‘Save’. Select ‘2048 bits’ for Key Size and ‘RSA’ for the algorithm in next screen and proceed.
- CSR file would created on the desktop by Certificate Authority.
Submitting a Certificate Signing Request for Approval:
- Once CSR file is created log in to the iPhone developer program portal and go to ‘Certificates’> ‘Development’ and select ‘Add Certificate’.
- Click the ‘Choose file’ button, select your CSR and click ‘Submit’. The portal will reject the CSR if Key Size is not set to 2048 bit at the time of CSR creation.
- This will followed by notification to Team Admins by email of the certificate request.
- The change in the certificate status would informed by email on approval or rejection of the CSR by Team Admin.
Download/Installing Certificate on your machine
- Once the CSR is approved the Team Members and Team Admins can download their certificates via the ‘Certification’ section of the Program Portal. Choose ‘Download’ next to the certificate name to download your iPhone development certificate to your local machine.
- Once this is done double-click the .cer file to launch Key chain Access and install your certificate.
Follow the following steps to create an App ID:
- Go to ‘App IDs’ and click ‘App ID’ after logging in to iPhone developer program portal.
- Populate the ‘App Id Name’ field with your application name (that is – iPhone app) and in ‘App Id’ enter something like com.yourdomain.applicationname (i.ecom.companyname.iPhoneapp) and click submit.
- Please do note down the “App Id” as this would be utilized in Info.plist, bundle identifier tag.
Next step would be to create a Provisioning file for our X code and is the last step for creating binary which would submit it to App Store.
- After you navigate to ‘Provisioning’> ‘Distribution’ click ‘Add Profile’ in iPhone developer program portal.
- Choose “App Store” in “Distribution Method”.
- In “Profile Name” enter your application name (i.e iPhone app) which will be your provisioning profile name as well.
- In “App ID” select the app name(i.e. iPhone app) which you created in Step 2.
- After downloading the Provisioning profile copy it to your/YourUserName/Library/MobileDevice/Provisioning Profile.
Now everything is step up, open your project in Xcode
- Click “i” Info button after selecting your project from “Group & File” in left side bar.
- Navigate to “Configuration” tab and select “Release”. Click the “Duplicate” button from bottom, name is “iPhone Distribution”.
- Click on “Build” tab and choose “iPhone Distribution” and enter in “Search in Build Settings” filed ‘Base SDK’ and select the current selected Device and change to what gadget your application is targeting.
- Now in “Search in build setting” field enter “code signing identity” and choose the provisioning profile created earlier in Step 3. Apply the same to the child property “Any iPhone OS Device”.
- Once this done close the Info screen and select the “Target”> “Your App” from “Group & File” in left side bar and click on “Info” button again from X code.
- To be on the safer side repeat step 3 and 4.
- With the Info screen still open click on “Properties” tab and enter “App Id”(i.e. com.companyname.iPhoneapp) in Identifier field.
- Now that all is done, click on “Build” (cmd+B) from X code>Build.
- You will find your binary file created on right clicking on “Product”> “YourApp” and selecting “Reveal in Finder”. Zip this file.
The next step is to submit the binary file created to iTunes connect.
- In your browser type https://itunesconnect.apple.com/ and login using your iPhone developer account.
- Click on “Manage Your Account” > “Add Application”
- On replying to a simple question from apple you can submit your application to app store. You also need few things in your system before you submit your application.
b) Application description
c) Application Category
d) URL for your application feedback.
e) Icon of your application in 512 x 512 size.
f) Main picture of your application in 320 x 480 or 320 x 460 size.
(You have option to submit up to 4 more pictures of your application).