Build an app for distribution with Ionic Package

As just announced on the official blog post IonicPackage now lets you build an iOS app for distribution on Windows machine.

This indeed is a huge news. However, don't think you won't have to buy a Mac (or make your own Hackintosh or buy Mac in cloud or similar mumbo jumbo) to build an app for iOS. Well, at least for now you still have to set the certificate and provisioning profile for iOS builds (and you can do that only on a Mac).

Anyways, during the open alpha period, Ionic Package will be 100% free to use, and later they promised to have a free dev package as well.

In order to try this out first update your Ionic CLI to the newest version:

npm install -g ionic

Then, when you're done with your app, you have to make sure that you uploaded it to Ionic with:

ionic upload

Build for Android

If you want to build for Android it execute:

ionic package build android

The output of the command looks something like this:

> ionic package build android --profile dev                                
[=============================]  100%  0.0s
Preparing your resources...
Uploading your resources to Ionic...
Submitting your app to Ionic Package...
Your app has been successfully submitted to Ionic Package!
Build ID: 1
We are now packaging your app.

To check the status of the packaging execute:

ionic package list

You should see something similar to this output:

> ionic package list                                                       

  id │ status  │ platform │ mode  │ started
  1  │ SUCCESS │ android  │ debug │ Oct 14th, 2015 21:20:33

Showing 1 of your latest builds.

If the status shows SUCCESS then you can finally download the build by executing:

ionic package download BUILD_ID

Where, of course you would enter your own BUILD_ID number. In my case the command would be:

ionic package download 1

The output of the command shows where the .apk file has been downloaded:

> ionic package download 1                                                 
Downloading... [=============================]  100%  0.0s

Wrote: /Users/nikola/Desktop/ionicTesting/ionicPackageTest/ionicPackageTest.apk
 ✓ Done!

You can learn more about how to use the Ionic Android build tools from official documentation.

Build for iOS

The process is basically the same as for Android, with the added prerequisite of creating certificate and provisioning profile. You can learn more about how to use the Ionic iOS build tools from official documentation.

Written by Nikola Brežnjak