gar*_*ing 11 react-native expo
运行时expo ios,默认连接类型为LAN. 通过 app.json、metro.config.js 或 .env,如何将类型配置tunnel为默认类型?
小智 21
自从你问这个问题以来已经有一段时间了,所以我想你已经找到了答案。您需要将 package.json 中的“start”脚本更改为“expo start --tunnel”。
"scripts": {
"start": "expo start --tunnel",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
Run Code Online (Sandbox Code Playgroud)
我遇到了同样的问题,我尝试将脚本更改为:
{
"scripts": {
"start": "expo start --tunnel",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web"
}
}
Run Code Online (Sandbox Code Playgroud)
但这没有用。然后我必须直接运行命令:
npx expo start --tunnel
Run Code Online (Sandbox Code Playgroud)
然后一切正常。
| 归档时间: |
|
| 查看次数: |
21456 次 |
| 最近记录: |