首页 > 代码库 > react-native 打包
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 runcurl 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 themain.jsbundle
file that you generated.
react-native 打包
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。