how to get offline bunduling of ios in react native

我的梦境 提交于 2019-12-04 14:17:06

问题


Anyone could you please explain how to generate offline bundle of ios application from 'react native' code.

Already I tried "How to generate .ipa file for react-native?" but this not working.


回答1:


react-native run-ios --configuration=release

Will run your app on Simulator or Device with the bundle.

Or just build it from Xcode (release build always includes the bundle) Or run the debug release but before that, you should :

react-native bundle --dev false --entry-file index.ios.js --bundle-output ios/main.jsbundle --platform ios

Also, new react-native versions index.ios.js not found because of we need run this,

react-native bundle --dev false --entry-file index.js --bundle-output ios/main.jsbundle --platform ios



回答2:


I am assuming you wish to run the app on a ios device without deploying it into the app store. If that is the case then:

First I would make sure I have ios-deploy installed.

You can do so by running npm install -g ios-deploy

Then connect the iphone you want the app to be installed in into your mac.

Then run

react-native run-ios --device "XYZ’s iPhone" --configuration=release

This would create a offline js bundled app and install it onto the iphone.

PS: If it errors out saying

Signing for "<app name>" requires a development team. 
Select a development team in the project editor.

Then open up the project inside ios/ in Xcode and Select the target -> General Tab Under signing choose the signing team and choose automatically manage signing.

Then save and re-run the command.




回答3:


Method 1

Step one:

react-native bundle --entry-file index.ios.js --bundle-output ./ios/main.jsbundle --platform ios

Step two:

react-native run-ios --configuration=release 

This worker for me.

Method 2 use xcode and change debug to release enter image description here



来源:https://stackoverflow.com/questions/42091721/how-to-get-offline-bunduling-of-ios-in-react-native

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!