Search code examples
react-nativeexpoexpo-web

How To Start Expo Web In A Specific Browser?


On my Mac, I have Chrome, Firefox, and Safari installed. Safari is set as the default system browser.

Launching expo web using;

expo start -w

works. However, it launches the URI in Chrome rather than Safari. If I delete the Chrome browser, expo will launch in Safari. However I would like to continue with multiple browsers installed.

How can this be overridden so I can choose Safari?


Solution

  • This issue provides the answer:

    https://github.com/expo/expo-cli/issues/1004

    As a workaround, you can force a different browser using the BROWSER environment variable.

    For me, env BROWSER=firefox expo start works.

    For different browsers, use one of the following:

    Safari

    env BROWSER=safari expo start -w
    

    Firefox

    env BROWSER=firefox expo start -w
    

    Chrome

    env BROWSER=Google\ Chrome expo start -w
    

    Brave

    env BROWSER=Brave\ Browser expo start -w