我一直在努力寻找有关如何正确创建 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 运行应用程序并且:
- Open
ios/YourApp/AppDelegate.m
- Uncomment the line,
jsCodeLocation = [[NSBundle mainBundle] ...
关于javascript - 在 TestFlight 上测试 React Native App,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33422326/