ionic capacitor run
Run an Ionic project on a connected device
$ ionic capacitor run [options]
ionic capacitor run
will do the following:
- Perform
ionic build
(or run the dev server fromionic serve
with the--livereload
option) - Run
capacitor run
(or open IDE for your native project with the--open
option)
When using --livereload
with hardware devices, remember that livereload needs an active connection between device and computer. In some scenarios, you may need to host the dev server on an external address using the --external
option. See these docs for more information.
If you have multiple devices and emulators, you can target a specific one by ID with the --target
option. You can list targets with --list
.
For Android and iOS, you can setup Remote Debugging on your device with browser development tools using these docs.
#
Examples$ ionic capacitor run $ ionic capacitor run android$ ionic capacitor run android -l --external$ ionic capacitor run ios --livereload --external$ ionic capacitor run ios --livereload-url=http://localhost:8100
#
Inputsplatform | |
---|---|
Description | The platform to run (e.g. |
#
Options--list | |
---|---|
Description | List all available targets |
--target =<target> | |
Description | Deploy to a specific device by its ID (use |
--open | |
Description | Open native IDE instead of using |
--no-build | |
Description | Do not invoke Ionic build |
--external | |
Description | Host dev server on all network interfaces (i.e. |
--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 |
#
Advanced Options--host =<host> | |
---|---|
Description | Use specific host for the dev server |
Default | localhost |
--port =<port> | |
Description | Use specific port for the dev server |
Aliases | -p |
Default | 8100 |
--public-host =<host> | |
Description | The host used for the browser or web view |
--configuration =<conf> | |
Description | Specify the configuration to use. |
Aliases | -c |
--source-map | |
Description | Output source maps |
--watch | |
Description | Rebuild when files change |