码迷,mamicode.com
首页 > 其他好文 > 详细

react-native 打包

时间:2016-09-02 13:22:38      阅读:129      评论:0      收藏:0      [点我收藏+]

标签:

 

//关于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 打包

标签:

原文地址:http://www.cnblogs.com/fanhaotian/p/5832914.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!