This is my first time to upload an iOS app, created by ionic, to AppStore (or TestFlight), and it costs a lot of time. Finally and fortunately, uploading is successful. Now I’ll explain how to do that, and also I can also recall this for future use.
First of all, you need to ensure your ionic project can be built in Xcode and run in emulators or real iOS devices.
Something you need to prepare:
Apple Developer Account
You can get this from Apple Developer Program with $99 per year.
Valid Certificate for iPhone Distribution
You can check it in your Keychain Access (Open Spotlight by
CMD + Whitespaceand search Keychain Access).
If your certificate is shown as invalid or not valid issued, it might mean you install new WWDR intermediate certificate for your certificate:
- Download new WWDR intermediate certificate.
- Install the WWDR intermediate certificate by double-clicking on the file.
- Select View -> Show Expired Certificates in Keychain Access to show show the expired certificates and delete the expired version of the Apple Worldwide Developer Relations Certificate Authority Intermediate certificate if any exists.
- Then you should see your certicate like this:
- New Bundle Identifier for Your App
You can create a new id in Apple Developer: Certificates, Identifiers & Profiles.
And then you also need to create your app with the created bundle identifier in iTunes Connect.
Submitting Your Build to iTunes Connect
Open up your ionic iOS project in Xcode. You can find your Xcode project file here:
Verify the project has the correct Bundle Identifier you have created, and you have chosen the correct Distribution Certificate under Code Signing -> Release in Build Settings (same certificates in Keychain Access):
Select Product -> Archive from the top menu bar.
After Xcode finishes archiving your project, click the Submit to App Store….
Choose your correct account and click Submit button.
It may take a while as your build is uploaded.
Once it completes, you should see the success message like this:
Some problems here:
No Submit to App Store… button
This is because the account you use is not enrolled in Apple Developer Program. Check the Apple Developer Account.
Missing Developer Profile or Valid Signing Identity Not Found
This is because you use wrong iPhone Distribution Certificate or your certificate in the KeyChain Access is invalid or expired. Check the Valid Certificate for iPhone Distribution.
No Suitable Record Found Verify Your Bundle Identifier Correct
This is because you may enter the wrong bundle identifer for the project. Check New Bundle Identifier for Your App.
Invalid Image Path for CFBundleIconFile
This is because some bug of cordova or Xccode, and it is supposed to remove this key value pair in the
-Info.plist automatically. The solution is go to path /platforms/ios/and just remove the / -Info.plist and tags of CFBundleIconFile.
Invalid Bundle Structure - XXX Not Permitted and May Contain Only One Executable
This is because you have included some other executable files in your project directory. Sometimes it happens because you include some external library. For ionic app, it may be because of including some phonegap library (eg. phonegap-plugin-push). The solution is just remove the files or the folder containing those files mentioned in the error message.
Get Stuck while Uploading and Action Failed
This is because your network is not good enough to upload the build. Change a network and try again.