cordova build

cordova build command

Synopsis

Shortcut for cordova prepare + cordova compile for all/the specified platforms. Allows you to build the app for the specified platform.

Syntax

cordova build [<platform> [...]]
    [--debug|--release]
    [--device|--emulator]
    [--buildConfig=<configfile>]
    [--browserify]
    [-- <platformOpts>]
Option Description
<platform> [..] Platform name(s) to build. If not specified, all platforms are built.
--debug Perform a debug build. This typically translates to debug mode for the underlying platform being built.
--release Perform a release build. This typically translates to release mode for the underlying platform being built.
--device Build it for a device
--emulator Build it for an emulator. In particular, the platform architecture might be different for a device Vs emulator.
--buildConfig=<configFile> Default: build.json in cordova root directory.
Use the specified build configuration file. build.json file is used to specify paramaters to customize the app build process esecially related to signing the package.
--browserify Compile plugin JS at build time using browserify instead of runtime
<platformOpts> To provide platform specific options, you must include them after -- separator. Review platform guide docs for more details.

Examples

  • Build for android and windows platform in debug mode for deployment to device:

    cordova build android windows --debug --device
    
  • Build for android platform in release mode and use the specified build configuration:

    cordova build android --release --buildConfig=..\myBuildConfig.json
    
  • Build for android platform in release mode and pass custom platform options to android build process:

    cordova build android --release -- --keystore="..\android.keystore" --storePassword=android --alias=mykey
    
doc_cordova
2017-01-31 03:40:02
Comments
Leave a Comment

Please login to continue.