Gabriel Francisco
Gabriel Francisco

Reputation: 321

How to change Flutter DevTools default browser?

Can I change the default browser that is used for Flutter DevTools? Is it compatible with Firefox or other browser? In my case, I don't like Chrome very much, i's a little slow and heavy compared to firefox and others. I haven't found any solution so far, even changing the settings through VS Code. Thanks!

Upvotes: 19

Views: 24504

Answers (4)

narayann
narayann

Reputation: 481

its actually depends on code editor / ide

for vs-code

  • open setting
  • search dart.devToolsBrowser
  • change to default or any other browser

Upvotes: 7

Shourya Shikhar
Shourya Shikhar

Reputation: 1524

The other answers here pointed out solutions in Android Studio and starting a local server separately. But I wanted to start the whole debugging session in one command. So this is what I came up with in Linux:

I wanted to use Brave as the default browser. First run which brave-browser. Copy the outputted path (in my case, it was /usr/bin/brave-browser). Then open your bashrc or zshrc and paste the following line:

export CHROME_EXECUTABLE=THE_COPIED_PATH_FROM_PREVIOUS_STEP
# for me it became, CHROME_EXECUTABLE=/usr/bin/brave-browser

Lastly restart the shell:

source ~/.zshrc
# or source ~/.bashrc

Now, simply running flutter run -d chrome would open up the debugging session in Brave instead of Chrome(though in the console output, the messages will still be referring to Chrome).

Upvotes: 7

Harrison Steward
Harrison Steward

Reputation: 184

I don't think that anyone has properly answers this question yet so I'll give it a go.

In my case, my computers default browser is set to Safari but Safari doesn't work well with Flutters Dev Tools at the moment. So.. how can you keep your computers default browser and specify a browser you want to use when starting dev tools?

In Android Studio open up your Preferences and in the top left there is a search bar.

Type in "Web Browsers".

You will see a list of web browsers and you can click and drag. Place the one you want to use by default on top. For example I have chrome on the top of my list. Browser List

Now just set this from "System default" to "First listed" and apply your changes

enter image description here

When you press this button to open dev tools it will now, in my case, open chrome instead of safari even though Safari is my computers default browser. enter image description here

Upvotes: 14

Py Qana
Py Qana

Reputation: 379

  1. Use flutter run -d web-server
  2. open app with browser other than Chrome

Upvotes: 27

Related Questions