Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Expo: Default browser for expo start

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?

like image 779
J. Hesters Avatar asked Feb 26 '19 10:02

J. Hesters


People also ask

Does Expo Use React Native web?

The web part of your app runs with React Native for web which powers massive websites and progressive web apps like Twitter, and Major League Soccer. The Expo SDK also utilizes native browser functionality like Video, Camera, and Gestures without the need for a custom native browser.

How do I open the Expo menu?

Showing the Developer Menu Terminal UI: Press M in the terminal to open the menu on connected iOS and Android. iOS Device: Shake the device a little bit. iOS Simulator: Hit Ctrl + Cmd ⌘ + Z on a Mac in the emulator to simulate the shake gesture, or press Cmd ⌘ + D .


1 Answers

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",
    ...
  },
  ...
}

like image 195
David Ewen Avatar answered Oct 20 '22 21:10

David Ewen