首页 > 其他 > 详细

React Native note

时间:2016-04-16 15:23:58      阅读:211      评论:0      收藏:0      [点我收藏+]

1.

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.
You can now run the app on a device (either via usb or TestFlight) without needing to have a server running.

cited from https://github.com/facebook/react-native/issues/240#issuecomment-86977126

React Native note

原文:http://www.cnblogs.com/alex-wood/p/5398400.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!