Search docs/

ionic cordova build

Contents

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

ionic cordova build <platform> [options]

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, so an additional separator is required for the Ionic CLI, but it is not required for iOS builds. See the example commands for usage with separators. To avoid using flags, consider using --buildConfig with a build.json file.

Examples

ionic cordova build androidionic cordova build android --buildConfig=build.jsonionic cordova build android --prod --release -- -- --gradleArg=-PcdvBuildMultipleApks=trueionic cordova build android --prod --release -- -- --keystore=filename.keystore --alias=myaliasionic cordova build android --prod --release -- -- --minSdkVersion=21ionic cordova build android --prod --release -- -- --versionCode=55ionic cordova build android --prod --release --buildConfig=build.jsonionic cordova build iosionic cordova build ios --buildConfig=build.jsonionic cordova build ios --prod --releaseionic cordova build ios --prod --release -- --developmentTeam="ABCD" --codeSignIdentity="iPhone Developer" --packageType="app-store"ionic cordova build ios --prod --release --buildConfig=build.json

Inputs

platform

Description

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

Options

--no-build

Description

Do not invoke an Ionic build

--debug

Description

Mark as a debug build

--release

Description

Mark as a release build

--device

Description

Deploy build to a device

--emulator

Description

Deploy build to an emulator

Advanced Options

--buildConfig=<file>

Description

Use the specified build configuration

--configuration=<conf>

Description

Specify the configuration to use.

Aliases-c

--source-map

Description

Output source maps