Skip to main content

ionic cordova build

Use Cordova to build for Android and iOS platform targets

$ ionic cordova build [options]

Like running cordova build directly, ionic cordova build also builds web assets from ionic build and provides friendly checks for Android and iOS platforms.

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 android
$ ionic cordova build android --buildConfig=build.json
$ ionic cordova build android --prod --release -- -- --gradleArg=-PcdvBuildMultipleApks=true
$ 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 --buildConfig=build.json
$ ionic cordova build ios
$ ionic cordova build ios --buildConfig=build.json
$ ionic cordova build ios --prod --release
$ ionic 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

--prod

Description

Flag to use the production configuration

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