cordova run

cordova run command

Synopsis

Prepares, builds, and deploys app on specified platform devices/emulators. If a device is connected it will be used, unless an eligible emulator is already running.

Syntax

cordova run [<platform> [...]]
    [--list | --debug | --release]
    [--noprepare] [--nobuild]
    [--device|--emulator|--target=<targetName>]
    [--buildConfig=<configfile>]
    [--browserify]
    [-- <platformOpts>]
Option Description
<platform> [..] Platform name(s) to run. If not specified, all platforms are run.
--list Lists available targets. Displays both device and emulator deployment targets unless specified
--debug Deploy a debug build. This is the default behavior unless --release is specified.
--release Deploy a release build
--noprepare Skip preparing (available in Cordova v6.2 or later)
--nobuild Skip building
--device Deploy to a device
--emulator Deploy to an emulator
--target Deploy to a specific target emulator/device. Use --list to display target options
--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

  • Run a release build of current cordova project on android platform emulator named Nexus_5_API_23_x86. Use the spcified build configuration when running:

    cordova run android --release --buildConfig=..\myBuildConfig.json --target=Nexus_5_API_23_x86
    
  • Run a debug build of current cordova project on android platform using a device or emulator (if no device is connected). Skip doing the build:

    cordova run android --nobuild
    
  • Run a debug build of current cordova project on an ios device:

    cordova run ios --device
    
  • Enumerate names of all the connected devices and available emulators that can be used to run this app:

    cordova run ios --list
    
doc_cordova
2017-01-31 03:40:07
Comments
Leave a Comment

Please login to continue.