I have multiple browser windows usually and it's always not popping up on the one I want.
Can I disable the feature of ionic serve opening in a browser?
ionic serve run the app and then ctrl + c to cancel.
ionic serve can only be run in an Ionic project directory, make sure you create an empty "www" directory at the project root. If cordova does not find a "www" directory, it will cry out that error.
You can pass in the --nobrowser
option, or simply -b
:
ionic serve --nobrowser
Old CLI: As @Claudiu mentioned ionic server -b
will not start a browser.
New CLI: the new command is ionic serve --no-open
.
If you want to start a browser but not the default one, you can use the -w
option.
Eg if Chrome is your default browser, but you want ionic serve
to use Firefox instead, you can do something like
ionic serve -w "path/to/firefox.exe"
or just ionic serve -w firefox
if Firefox is in the path.
More info on ionic serve
options:
ionic serve --help
ionic serve --no-open
is the new command. The no-browser has been deprecated
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With