Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you set default `CONNECTION` to `tunnel` with Expo?

When running expo ios, the default connection type is LAN. Via app.json, metro.config.js, or .env, how does one configure type tunnel to be the default?

like image 360
garrettmaring Avatar asked Dec 27 '25 20:12

garrettmaring


2 Answers

It's been a while since you asked this question so I assume you have already figure out the answer. You need to change the "start" script in package.json to "expo start --tunnel".

  "scripts": {
    "start": "expo start --tunnel",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
like image 153
porkupan Avatar answered Dec 30 '25 23:12

porkupan


I was having the same issue and I tried to change my scripts to:

{
   "scripts": {
    "start": "expo start --tunnel",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web"
  }
}

But it didn't work. I then had to run the command directly:

npx expo start --tunnel

Then everything worked fine.

like image 25
crispengari Avatar answered Dec 30 '25 23:12

crispengari