Tips & Tricks
617

How to Release Your Cordova App for iOS and Android

So you’ve built a Cordova app and you’re ready to release it out into the world — congratulations! This guide will show you how to deploy your Cordova app on the App Store and Google Play.

How to release your Cordova app for iOS

Prerequisites

  • Have a Cordova project with an iOS app
  • Make sure that you are running on Apple OS X. You can check with the following code:
cordova requirements

The result will look like this:

Requirements check results for ios:
Apple OS X: installed

Build a deployable iOS project

Run the following command:

cordova build ios

As soon as the building is completed successfully, you will find the project in /platforms/ios/iOSApp

Open the project in Xcode

From the command line:

open ./platforms/ios/iOSApp.xcworkspace/

Finally, sign and publish your app on the App Store

How to release your Cordova app for Android

Update your release information

  • Open the config.xml and package.json files in your project’s directory.
  • Edit all the release details you need: the widget ID, app icon, and versioning.

Make sure you build properly

From the Cordova directory execute the following:

$ cordova platform remove android

Open config.xml and add the following bracket where instabug is the name of your domain and androidapp is the name of your app. The result will look like this:

# config.xml
<widget id="com.instabug.androidapp"> 
…

Specify if you want the icon to apply to all platforms or Android only

This can be done by adding the following:

# config.xml
<widget>
...
  <icon src="/path/to/generic/icon" /> # for all platforms icon
  <platform name="android">
    <icon src="/path/to/android/icon" /> # android specific icon
  </platform
...
</widget>

Specify the version of your app

Remember to increment every time when building a new release. This can be done by adding the following:

# config.xml <widget version="1.0.0"> …

Add the Android platform back

$ cordova platform add android

Sign your Android app

Cordova has a built-in way to let you sign Android apps quickly. This is done with a config file, build.json, which will carry all the needed information to sign the app. The file should look like this:

{
    "android": {
        "debug": {
            "keystore": "../android.keystore",
            "storePassword": "android",
            "alias": "mykey1",
            "password" : "password",
            "keystoreType": ""
        },
        "release": {
            "keystore": "../android.keystore",
            "storePassword": "",
            "alias": "mykey2",
            "password" : "password",
            "keystoreType": ""
        }
    }
}

Edit the config file to your liking.

When it’s ready, execute the following command:

cordova build android -- release -- buildConfig=build.json

Now you should have your final product: app-release.apk

Finally, upload your APK to the Google Play Store

Share using
Tags: , ,

More Similar Posts

Most Viewed Posts
Menu