Expo: Default browser for expo start

2.8k Views Asked by At

Is there a way to change the browser in which the Expo interface (http://localhost:19002/) opens after expo start?

My default browser is Firefox, which I use for my private life. My work and coding browser is Chrome. Is there a way to tell Expo to use Chrome by default?

2

There are 2 best solutions below

0
David Ewen On

expo start looks at the BROWSER environment variable before using the default browser so you can switch to Chrome just by setting that env var before calling expo start

As a raw command it looks like this for Windows:

set BROWSER=%ProgramFiles(x86)%\Google\Chrome\Application\chrome.exe && expo start

For my workflow I have just updated package.json so the yarn run start script does it for me:

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "set BROWSER=%ProgramFiles(x86)%\\Google\\Chrome\\Application\\chrome.exe && expo start",
    ...
  },
  ...
}

1
Bilal Sabugar On

Most easy way is to copy your "http://localhost:19002/" and paste it in browser where you want to open your project