javascript - 在 TestFlight 上测试 React Native App

标签 javascript ios reactjs react-native testflight

我一直在努力寻找有关如何正确创建 React Native 构建的文档,该构建不需要在本地网络上并且可以使用运营商网络,然后可以部署到 TestFlight 上进行测试。

我已经能够在 TestFlight 上获得稳定,但无法弄清楚如何让应用程序在本地网络之外运行。

我已经尝试过了,但没有成功:

Inside the project AppDelegate.m, uncomment the line below the OPTION 2 comment:

jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];

This causes the app to load from pre-bundled file on disk. Next, with the development server running (started with npm start), you can curl the URL in the comment, adding an extra dev query parameter:

curl http://localhost:8081/index.ios.bundle\?dev\=0 -o main.jsbundle'

有什么想法吗?

最佳答案

Since v0.14 JS and images are automatically packaged into the iOS app using Bundle React Native code and images Xcode build phase.

您所要做的就是从 XCode 运行应用程序并且:

  1. Open ios/YourApp/AppDelegate.m
  2. Uncomment the line, jsCodeLocation = [[NSBundle mainBundle] ...

关于javascript - 在 TestFlight 上测试 React Native App,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33422326/

相关文章:

ios - 如何在 Swift 中使用扩展方法作为参数?

ios - Alamofire 图片 : Fetch Image from AutoPurgingImageCache after af_setImageWithURL()

ios - 如何在 TextView / WebView 中进行左对齐和对齐

javascript - 从条件变量调用函数 - ReactJS

javascript - 在 ReactJS 中获取请求

javascript - 调整图像大小以匹配相框的宽度和高度

javascript - AngularJS:如何使用 ng-repeat 添加类

javascript - 从指令中的编译函数访问 Controller

javascript - 在对象中显示字符串

javascript - 在 react 组件中,一旦使用 redux 从另一个组件更改了状态,如何从状态中获取最新数据?