Framework v4 BETA

ionic cordova build

ionic cordova build <platform> [options]

Build (prepare + compile) an Ionic project for a given platform

Like running cordova build directly, but also builds web assets with configuration from ionic build and provides friendly checks.

To pass additional options to the Cordova CLI, use the -- separator after the Ionic CLI arguments.

The Cordova CLI requires a separator for platform-specific arguments for Android builds[1], so an additional separator is required for the Ionic CLI, but it is not required for iOS builds[2]. See the example commands for usage with separators. To avoid using flags, consider using --buildConfig with a build.json file.

[1]: https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#using-flags
[2]: https://cordova.apache.org/docs/en/latest/guide/platforms/ios/index.html#using-flags

Examples

shell
$ ionic cordova build ios
$ ionic cordova build ios --prod --release
$ ionic cordova build ios --prod --release -- --developmentTeam="ABCD" --codeSignIdentity="iPhone Developer" --packageType="app-store"
$ ionic cordova build ios --buildConfig=build.json
$ ionic cordova build ios --prod --release --buildConfig=build.json
$ ionic cordova build android
$ ionic cordova build android --prod --release -- -- --keystore=filename.keystore --alias=myalias
$ ionic cordova build android --prod --release -- -- --minSdkVersion=21
$ ionic cordova build android --prod --release -- -- --versionCode=55
$ ionic cordova build android --prod --release -- -- --gradleArg=-PcdvBuildMultipleApks=true
$ ionic cordova build android --buildConfig=build.json
$ ionic cordova build android --prod --release --buildConfig=build.json

Inputs

platform

Required: true
The platform to build (e.g. android, ios)

Options

--no-build

Type: boolean
Do not invoke an Ionic build

--debug

Type: boolean
Create a debug build

--release

Type: boolean
Create a release build

--device

Type: boolean
Create a build for a device

--emulator

Type: boolean
Create a build for an emulator

--buildConfig

Type: string
Use the specified build configuration