How do I set ionic serve to use Chrome as the defa

2020-07-02 11:56发布

I want to run ionic serve with Google Chrome.

I've tried:

ionic serve --browser chrome
ionic serve --browser google-chrome

But that doesn't work. I can get it to use firefox if I type:

ionic serve --browser firefox

How do I set the default browser for ionic serve to Chrome?

11条回答
趁早两清
2楼-- · 2020-07-02 12:14

On Mac, option -f chrome is not working, on ionic version 2.1.8

Use ionic serve --browser "google chrome"

It will set the default browser to Chrome.

查看更多
不美不萌又怎样
3楼-- · 2020-07-02 12:15

ionic serve -w chrome this works for me and successfully launch my app on chrome

查看更多
不美不萌又怎样
4楼-- · 2020-07-02 12:18

Try ionic serve -f chrome. This will set default ionic browser to Chrome and subsequent ionic serve commands will run in Chrome.

查看更多
Summer. ? 凉城
5楼-- · 2020-07-02 12:18

And this works on my Mac:

ionic serve --browser "google chrome"

查看更多
forever°为你锁心
6楼-- · 2020-07-02 12:20

As of working in Ionic v3.9.2, you can open this using

$ionic lab --browser chrome 

command to open the app in Google Chrome by default.

查看更多
狗以群分
7楼-- · 2020-07-02 12:31

Try ionic serve -w chrome, this will serve ionic2 in Chrome (ionic2 RC4+)

查看更多
登录 后发表回答