Ionic serve ---browser chrome not working on OSX


#1

I’m not being able to get “ionic serve” to run only with Chrome on OSX.
Things I’ve tried:

OSX Default browser: Safari

  • ionic serve // Runs Safari
  • ionic serve --browser chrome // Runs serve, doesn’t open any browser
  • ionic serve --browser google-chrome // Same as above
  • ionic serve --browser firefox // Runs Firefox
  • ionic serve -f chrome // Runs serve, doesn’t open any browser
  • ionic.project “defaultBrowser”: “chrome” // Runs serve, doesn’t open any browser
  • ionic.project “defaultBrowser”: “google-chrome” // Same as above
  • ionic.project “defaultBrowser”: “firefox” // Runs Firefox

OSX Default browser: Chrome

  • ionic serve // Runs Chrome
  • ionic serve --browser safari // Runs Safari
  • ionic serve --browser firefox // Runs Firefox
  • ionic.project “defaultBrowser”: “safari” // Runs Safari
  • ionic.project “defaultBrowser”: “firefox” // Runs Firefox

So if Chrome is not the OSX default browser, I can’t make “ionic serve” to work with it.
Any idea if it relates to my system or ionic and how do I fix it/make serve use chrome?

Thanks!


#2

Same problem here, looking for a way to serve on Chrome without having to set it to OSX default.


#3

Use

ionic serve --browser "google chrome"

or in your ionic.project:

"defaultBrowser": "google chrome"