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?
Asked
Active
Viewed 1.6k times
11

lovelikelando
- 7,593
- 6
- 32
- 50
-
Did you ever get a solution for this? If so, you should answer your own question for future searchers. – monsto Feb 12 '21 at 20:18
-
I didn't :/ I just put up with clicking on 'tunnel' on restarts for the time being. – lovelikelando Feb 12 '21 at 23:52
3 Answers
20
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"
},

porkupan
- 301
- 2
- 5
4
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 I didn't work. I then run directly the command:
expo start --tunnel
Then everything worked fine.

crispengari
- 7,901
- 7
- 45
- 53
1
Btw, on July 25th, the Expo team announced "Sunsetting the Web UI for Expo CLI".
So, only the commands typed in the terminal stand:
"start": "expo start --tunnel",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
or writing them in the package.jason
--> scripts, as @porkupan suggested.

Alex Vinulescu
- 71
- 1
- 4