Can I specify a browser for "ionic serve" command?

My default browser is Firefox but I want to use Chrome(with new window) for “ionic serve”.
Is there a option or other way to specify a browser?

3 Likes

Hm, I just set firefox to my default browser and ionic serve launched it there no problem.

Are you on osx or windows?

1 Like

I want to use NOT default browser, in my case, not Firefox but Google Chrome. Sorry if my English is not clear.

Ahh alright.
No at the moment, ionic serve will just pick your default browser.

You could open an issue for this on the cli repo as a feature request.

I sent pull request. I hope you will approve.

2 Likes

@Fujikawa @mhartington this seems to have been integrated: https://github.com/driftyco/ionic-cli/issues/328
but the proposed flag ( --d ) doesn’t seem to be working for me. How do I go about using this nifty feature?

To set your default browser, you only have to do this the first time

ionic serve -f safari

and then anytime you run ionic serve, it will use, in this case, safari instead of chrome

5 Likes

should it still working? I tried ionic serve -f chrome but it still opens my default browser

I found it, it is
ionic serve -w chrome

6 Likes

It works for me, but should remove “r” in “server” word :slight_smile:

Thanks, typo, I fixed that

This worked for me on MacOS:

$ionic serve --browser "google chrome”

1 Like

thanks its just i need , this command working for me , sorry my english is bad

ionic serve -w chrome

run this command

  1. ionic serve -w chrome (for chrome)
  2. ionic serve -w firefox (for mozila)
  3. ionic serve -w explorer (for IE)
1 Like

hi,

but in my case,when i am running ionic serve command,it showing no browser.so what to do.its not opening any browser,

try npm run ionic:serve --verbose

the easiest way is to copy past your link ‘http://localhost:8100/#/Yourpage’ form Firefox to chrome

it works for me! thanks

ionic serve -w chrome worked for me on windows

Simple way, specify --no-open and dont start any browser now:

ionic serve --no-open --port 8200