有没有可能在iOS设备上直接从命令行运行react-native 应用程序,就像我们在simulator with react-native run ios --simulator "iPhone 5s"
上所做的那样?
有没有可能在iOS设备上直接从命令行运行react-native 应用程序,就像我们在simulator with react-native run ios --simulator "iPhone 5s"
上所做的那样?
以下内容对我有效(在REACT原生0.38
和0.40
上进行了测试):
npm install -g ios-deploy
# Run on a connected device, e.g. Max's iPhone:
react-native run-ios --device "Max's iPhone"
如果您try 运行run-ios
,您将看到脚本建议在构建之后执行安装步骤时执行npm install -g ios-deploy
.
虽然关于原生Reaction提供的各种命令的文档有点粗略,但值得go 看react-native/local-cli个.在那里,您可以看到所有可用的命令及其运行的代码-因此,您可以计算出哪些switch 可用于未记录的命令.