Building and publishing an app for iOS

Publishing on App Store could be a frustrating process if you are not well prepared upfront. In this section, you will walk through the steps to properly configure everything in Apple Developer Center, iTunes Connect and local Xcode project.

Getting ready

You must register for Apple Developer Program in order to access https://developer.apple.com/macos/touch-bar/ and https://itunesconnect.apple.com, because those websites will require an approved account.

In addition, the following instructions a the specific version of these components:

  • Mac OS X El Capitan 10.11.2
  • Xcode 7.2
  • Ionic CLI 2.0
  • Cordova 5.4.1

How to do it…

Here are the instructions:

  1. Ensure that you are in the app folder and build for the iOS platform:
    $ ionic build ios
    

    Go to the /platforms/ios folder to open the .xcodeproj file in Xcode. Observe the following screenshot:

    How to do it…
  2. Go through the General tab, as illustrated in the following screenshot, to make sure that you have the correct information for everything, especially Bundle Identifier and Version. Change and save as needed:
    How to do it…
  3. Visit the Apple Developer website and click on Certificates, Identifiers & Profiles, as illustrated:
    How to do it…
  4. Select the correct device platform you are targeting. In this case, it will be iOS, tvOS, watchOS as shown:
    How to do it…
  5. For the iOS app, you need the certificate, app ID, test device, and provisioning profile. To start with the certificate, navigate to Certificates | All, as follows:
    How to do it…
  6. Click on the (+) plus button, as shown in the following screenshot:
    How to do it…
  7. You just have to go through the steps in the website to fill out the necessary information, as depicted in the following screenshot:
    How to do it…
  8. Once you've completed the form, you can save the CSR file and import it to your Mac's Keychain Access.
  9. Navigate to Identifiers | App IDs, as follows, to create an app ID:
    How to do it…
  10. Click on the plus (+) button at the top right of the screen, as follows:
    How to do it…
  11. Fill in the form to register your App ID, as shown:
    How to do it…
  12. The important part here that you need to do correctly is the Bundle ID, as shown in the following screenshot, because it must match your Bundle Identifier in Xcode:
    How to do it…
  13. If your app needs Push Notifications or other App Services, you need to check those services on the page:
    How to do it…
  14. If you need to push the app to a specific device, you must register the device. Navigate to Devices | All, as illustrated:
    How to do it…
  15. Click on the plus (+) button, as shown:
    How to do it…
  16. Provide the device UDID, as follows, and save it in order to register the device:
    How to do it…
  17. Finally, you need a provisioning profile if one doesn't exist yet. Usually, Xcode will create one automatically. However, you could create your own by navigating to Provisioning Profiles | All, as shown:
    How to do it…
  18. Click on the plus (+) button, as follows:
    How to do it…
  19. Select App Store as your provisioning profile, as illustrated:
    How to do it…
  20. Select the correct App ID in the drop-down menu and save to finalize your provisioning profile creation, as follows:
    How to do it…
  21. Visit iTunes Connect at https://itunesconnect.apple.com and click on the My Apps button, shown as follows:
    How to do it…
  22. Select the plus (+) icon to select New App, as shown:
    How to do it…
  23. Fill out the form and ensure that you select the right Bundle Identifier of your app:
    How to do it…

    There are several additional steps to provide information about the app, such as screenshot, icon, and address. If you just want to test the app, you could provide some place holder information initially and come back to edit later.

    That's it to prepare your Developer and iTunes Connect account.

  24. Now, open Xcode and select iOS Device as the archive target. Otherwise, the Archive feature will not turn on. You will need to archive your app before you can submit to the App Store:
    How to do it…
  25. Navigate to Product | Archive in the top menu, as illustrated:
    How to do it…
  26. After the archive process is completed, select Submit to App Store to finish the publishing process.
  27. To publish, select Submit for Beta App Review. You may want to go through other tabs, such as Pricing and In-App Purchases, to configure your own requirements.

How it works…

Obviously, this section does not cover every bit of detail in the publishing process. In general, you just need to ensure that your app is tested thoroughly, locally, on a physical device (either via USB or TestFlight) before submitting it to the App Store.

If for some reason the Archive feature doesn't build, you could manually go to your local Xcode folder to delete that specific temporary archived app to clear cache, as shown:

~/Library/Developer/Xcode/Archives

There's more…

TestFlight is a separate subject by itself. The benefit of TestFlight is that you don't need your app to be approved by Apple in order to install the app on a physical device for testing and development. You can find out more information about TestFlight at https://developer.apple.com/library/content/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/BetaTestingTheApp.html.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.117.231