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.

Examples

ionic cordova run android ionic cordova run android --buildConfig=build.json ionic cordova run android --prod --release -- -- --gradleArg=-PcdvBuildMultipleApks=true ionic cordova run android --prod --release -- -- --keystore=filename.keystore --alias=myalias ionic cordova run android --prod --release -- -- --minSdkVersion=21 ionic cordova run android --prod --release -- -- --versionCode=55 ionic cordova run android --prod --release --buildConfig=build.json ionic cordova run android -l ionic cordova run ios ionic cordova run ios --buildConfig=build.json ionic cordova run ios --livereload ionic cordova run ios --livereload-url=http://localhost:8100 ionic cordova run ios --prod --release ionic 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

--build

Description

Do not invoke Ionic build

--livereload

Description

Spin up dev server to live-reload www files

Aliases -l

--livereload-url =<livereload-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

Advanced Options

--address =<address>

Description

Use specific address for the dev server

Default 0.0.0.0

--port =<port>

Description

Use specific port for HTTP

Aliases -p
Default 8100

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