Initial Settings:-
- Go to the project and open info.plist. Check whether the bundle identifier(com.yourcompany.appname) is correct.
- Go to Project settings->Targets->Summary and change the version number to the desired value.(Do not provide any characters), check the deployment target and double check the bundle identifier.
- Check the deployment target in Project Settings->Project->Info
- Create a distribution profile in the iOS Provisioning Portal with these characteristics:
- The app name in the name of the provisioning profile is optional.
- The app ID can identify a specific app or an app domain.
- Download the distribution provisioning profile.
- Install the distribution provisioning profile in your provisioning profiles library:
- Drag the <Profile_Name>.mobileprovision file to the Provisioning Profiles list in the Library section of the devices organizer.
- In your project, duplicate the Release build configuration and name the duplicate “AppStore”. This can be done by going to Project Settings->Project->Info and then click on Release. Just below that, you can see a '+' mark. Click on '+” mark and then select “Duplicate Release Configuration”.
- Set the Code Signing Identity of the project to the app's distribution profile.
- Go to Project Settings->Project->Build Settings
- Go to Code Signing section.
- Change identities in all sections(AppStore, Debug, Release) to newly downloaded app's distribution profile.(As explained in above section)
- Double check to be sure that you have selected proper distribution profile.
- In the Project Settings->Targets, delete the Validate Build Product build setting specification for the Release build configuration.
- Apple says it as delete, but you cannot delete it actually. Just make it as “NO” for Debug and Release. Make “Yes” for AppStore.
- Go to Product menu->Manage Schemes and duplicate the scheme that builds your app and name the duplicate as “<App_Name>-AppStore”.
- Select “<App_Name>-AppStore” and press Edit.
- Select “Archive” section and change the build configuration to “AppStore”.
- Select the AppStore scheme to build the project. (Next to Run and Stop button).
- Select the iOS Device option from the scheme toolbar menu.
- Choose Product > Archive.
- In the Archives organizer, select the archive.
- Click the Validate button.
- Enter your iTunes Connect credentials and click Next.
- Select the app you want to share and the appropriate signing identity, and click Next.
- Review validation issues found, if any, and click Finish.
- In the Archives organizer, select the archive.
- Click the Distribute button.
- Select “Submit to the iOS App Store” and click Next.
- Enter your iTunes Connect credentials and click Next.
- Select the app you want to share and the appropriate signing identity, and click Next.