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


#1

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?


#2

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

Are you on osx or windows?


#3

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


#4

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.


#5

I sent pull request. I hope you will approve.


#6

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


#7

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


#8

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


#9

I found it, it is
ionic serve -w chrome


#10

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


#11

Thanks, typo, I fixed that


#12

This worked for me on MacOS:

$ionic serve --browser "google chrome”


#13

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

ionic serve -w chrome


#14

run this command

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

#15

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,


#16

try npm run ionic:serve --verbose


#17

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


#18

it works for me! thanks


#19

ionic serve -w chrome worked for me on windows