Build Native installers using Ionic CLI from your terminal/prompt

Tweet about this on TwitterShare on LinkedIn0Share on Google+0Share on Reddit0Buffer this pageFlattr the authorEmail this to someonePrint this page

Build Native installers using Ionic CLI

This feature has been deprecated as of Ionic CLI 1.5.5. You will not find the package option in the CLI. Refer: issuecomment-109349399

Ionic recently launched a super awesome service where you can generate native installers write from your terminal/prompt. This service is in beta phase as of Ionic version 1.1.5. In this post, we will take a quick look at how we generate native installers using this service.

We are going to use the code base from Ionic Restify MongoDB – An End to End Hybrid App post. Instead of running the final product through PhoneGap build, we will use Ionic package CLI to generate the installer.

To get started, you can get the code base from GitHub or follow the post and build it yourself. If you are fetching the code from GitHub, create a new folder named ionicPackage and download/clone the code into that folder.

Open terminal/prompt inside the ionicPackage folder and run

git clone

and then  cd BucketListApp/dev/client/bucketListApp

Next, we will get the latest version of ionic and cordova run

[sudo] npm install -g cordova ionic

Once this is done, we will add ios/android platform support. If you are facing issues, please refer PhoneGap 3 CLI Setup on Mac & Windows.

Run from inside bucketListApp folder

ionic platform add ios  or  ionic platform add android

You should see

Screen Shot 2014-07-27 at 1.42.57 pm

And you should see a new platforms folder added with ios/android folder inside it.

Screen Shot 2014-07-27 at 1.44.49 pmNow, we will build the project

ionic build ios  or  ionic build android

You will see a few logs rolling and then you should see that the build is successful. Now, finally to the run app execute

ionic run ios  or  ionic run android

And you should see the emulator launch and the output would be like

Screen Shot 2014-07-27 at 1.47.12 pmYou can sign in and test if you want. Once you are happy with output, we will generate the installer.

As of today, below are the options which can be used along with the package  command.

Screen Shot 2014-07-27 at 1.49.41 pm

To generate an installer, you can run

ionic package debug android

You will need to register (if not done yet) and provide your Ionic credentials to access the service.

This will upload the source code to Ionic service and generate an installer. Once this process is completed, you will receive an email

Screen Shot 2014-07-27 at 1.58.27 pmAnd you can see the installer location in your terminal/prompt

Screen Shot 2014-07-27 at 2.00.04 pmYou can install and test the app on your device.

You can also create installers in release mode. This will generate app store ready installer, which you can directly upload to the app store.

Simple and Sweet right?

Thanks for reading! Do comment.

Tweet about this on TwitterShare on LinkedIn0Share on Google+0Share on Reddit0Buffer this pageFlattr the authorEmail this to someonePrint this page
  • Steven Pack

    Hey mate, you should update this with the current status. As at CLI 1.5.5, there is no package task. I read on the ionic forum it was dropped in 1.5.2. I suspect it will come back, but I just wasted a bit of time trying to figure out where it was.

    • / Arvind Ravulavaru

      Thanks Steve. I fixed the post with a warning.

  • Bruno Seixas

    This looks a like cool feature.
    It makes things a lot faster, workflow wise, and we get “free” from PhoneGap Build =)

  • C.k

    Thanks for post.
    Is there a guide for force app update from google play or apple store using ionic, please?

    • / Arvind Ravulavaru

      Thanks C.k.

      AFAI can see from the CLI, there is no command for that as of now. Thanks!

    • Mike Hartington

      Hey C.K., right now this is possible from our CLI. Any app in the app store would notify users when you submit a new version.

      So If you submitted a new version of an app to Apple’s App store, iOS and Apple would take care of alerting users when an update is made available.

      • C.k

        Thanks , how about android google play? How can we manage version of which app built with ionic?

        • Mike Hartington

          Well this would be something that you would do through the google dev console.