我试图直接从终端运行发布版本,但我没有找到这样做的选项.

在XCode中,需要做的是:

Product -> Scheme -> Edit Scheme (cmd + <), make sure you're in the Run tab from the side, and set the Build Configuration dropdown to release.

http://facebook.github.io/react-native/docs/running-on-device-ios.html#building-your-app-for-production

react-native-cli人中有没有同样的 Select ?大概react-native run-ios -configuration Release

我的目标是生成一个不需要正在运行的服务器提供给QA团队的构建.

推荐答案

我对React Native项目做了公关,以允许使用此功能.公共关系可以在这里查看:https://github.com/facebook/react-native/commit/ca7cbdee858e84c4a74a2d9c7be151f5cfdcfbfe

因此,在将来,要从终端运行版本构建,只需键入以下命令:npx react-native run-ios --configuration Release

如果要在真实设备上运行项目,请使用--device参数:

npx react-native run-ios --configuration Release --device "Your Device Name"

React-native相关问答推荐

'无法解析模块.安装react-native-pager-view后的实用程序/平台

React Native 动画.您必须在转换属性中精确指定一个属性.

react-native useEffect / useFocusEffect / useCallback 没有正确更新

React Native 组件中两次使用map的问题

React Native - 为什么我们对 Image 组件使用 tintColor 属性?

ReactNative 0.43-rc.2 FlatList -- 试图获取超出范围索引 0 的框架

TabNavigator 中的 React Navigation 传递props

错误:看起来您在另一个中嵌套了一个NavigationContainer

如何在 mac 上卸载 react-native-cli?

图像背景ResizeMode调整大小模式

React-native 在浏览器中打开链接并返回应用程序

redux-observable Promise 在单元测试中没有得到解决

Android 依赖 'com.google.android.gms:play-services-stats' 的编译(16.0.1)和运行时(17.0.0)类路径有不同的版本

INSTALL_FAILED_INSUFFICIENT_STORAGE 运行 npm run android 命令时出错

React-native google 登录给开发人员错误

当前未启用语法nullishCoalescingOperator

在 React Native 中检测向左滑动

React Navigation 切换背景 colored颜色 和样式 StackNavigator

react-navigation 标题有一条微弱的线

react-native 开始给出 Invalid 正则表达式无效错误