ionic cordova run

Contents

Run an Ionic project on a connected device

ionic cordova run [<platform>] [options]

Like running cordova run or cordova emulate directly, but performs ionic build before deploying to the device or emulator. Optionally specify the --livereload option to use the dev server from ionic serve for livereload functionality.

For Android and iOS, you can setup Remote Debugging on your device with browser development tools using these docs.

Just like with ionic cordova build, you can pass additional options to the Cordova CLI using the -- separator. To pass additional options to the dev server, consider using ionic serve and the --livereload-url option.

With the experimental --native-run flag, this command will first use Cordova to build your app, and then it will run it on a device using the native-run utility instead of Cordova.

Examples

ionic cordova run androidionic cordova run android --buildConfig=build.jsonionic cordova run android --prod --release -- -- --gradleArg=-PcdvBuildMultipleApks=trueionic cordova run android --prod --release -- -- --keystore=filename.keystore --alias=myaliasionic cordova run android --prod --release -- -- --minSdkVersion=21ionic cordova run android --prod --release -- -- --versionCode=55ionic cordova run android --prod --release --buildConfig=build.jsonionic cordova run android -lionic cordova run iosionic cordova run ios --buildConfig=build.jsonionic cordova run ios --livereloadionic cordova run ios --livereload-url=http://localhost:8100ionic cordova run ios --prod --releaseionic cordova run ios --prod --release -- --developmentTeam="ABCD" --codeSignIdentity="iPhone Developer" --packageType="app-store"ionic cordova run ios --prod --release --buildConfig=build.json

Inputs

platform

Description

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

Options

--list

Description

List all available targets

--no-build

Description

Do not invoke Ionic build

--livereload

Description

Spin up dev server to live-reload www files

Aliases-l

--livereload-url=<url>

Description

Provide a custom URL to the dev server

--prod

Description

Flag to use the production configuration

--ssl

Description

Use HTTPS for the dev server

--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

--native-run

Description

Use native-run instead of Cordova for running the app

--no-connect

Description

Do not tie the running app to the process

--json

Description

Output --list targets in JSON

Advanced Options

--address=<address>

Description

Use specific address for the dev server

Default0.0.0.0

--port=<port>

Description

Use specific port for HTTP

Aliases-p
Default8100

--source-map

Description

Output source maps

--configuration=<conf>

Description

Specify the configuration to use.

Aliases-c

--buildConfig=<file>

Description

Use the specified build configuration

--target=<target>

Description

Deploy build to a device (use --list to see all)