我应该什么时候运行“react-native start"? [英] When should I run `react-native start`?
问题描述
刚开始使用 React-Native(对于非 CRNA/Expo 案例),阅读 react-native 文档 或 了解 CLI 何时适合运行 react-native start
Just getting started with React-Native (for the non-CRNA/Expo case) and it's not clear to me after reading the react-native docs or Understanding the CLI when it's appropriate to run react-native start
react-native start --help
只是说启动网络服务器
.运行 react-native run-ios
也会启动相同的服务器,但它实际上也在模拟器中运行它.
react-native start --help
simply says starts the webserver
. Running react-native run-ios
also starts the same server except it also actually runs it in the simulator.
问题:什么时候运行 react-native start
与直接运行模拟器(即 react-native run-ios
)比较合适>)?
Question: When is it appropriate to run react-native start
vs. just running the simulators directly (i.e. react-native run-ios
)?
推荐答案
react-native start
和 npm start
一样,就像你说的启动 react 打包器/服务器.
react-native start
is same as npm start
and like you said it's to start the react packager/server.
我发现自己不得不使用 npm start
显式停止和启动服务器.
I have found myself in situations where I had to stop and start the server explicitly using npm start
.
要启动一个项目,您可以使用 react-native run-ios
并且它会同时启动模拟器和服务器,但如果应用程序已安装并且您想重新启动服务器,您可以在终端中明确停止它并使用 react-native start
或 npm start
重新启动它.
To start up a project, you use the react-native run-ios
and it starts up both the simulator and the server but in cases where the app has been installed and you want to restart the server, you can stop it explicitly in the terminal and use react-native start
or npm start
to start it up again.
这篇关于我应该什么时候运行“react-native start"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!