react-native 打包

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了react-native 打包相关的知识,希望对你有一定的参考价值。

 

//关于react-native  ios打包生成.bundle文件,在stackover上找到的答案,亲测有用

If anyone wants to improve on these instructions and add them to the docs, feel free, I can do it later if nobody else jumps on it - I just wanted to document it somewhere for now.

  • Open iOS/AppDelegate.m
  • Comment out jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle"];
  • Uncomment jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
  • Start up the packager with npm start and then run curl http://localhost:8081/index.ios.bundle -o main.jsbundle - if this fails (as it did on my machine) add the --ipv4 flag to the end of it.
  • In XCode, right click on your project directory and click Add Files to "Project Name Here" - choose the main.jsbundle file that you generated.

以上是关于react-native 打包的主要内容,如果未能解决你的问题,请参考以下文章

解决react-native 打包apk 图片 不出现问题

安卓转战React-Native之签名打包成Apk并极速多渠道打包

使用 Relay 和 React-Native 时的条件片段或嵌入的根容器

react-native 打包

react-native打包apk常见错误收集

react-native打包apk报错