react-native: 0.41.2
问题是,我正在尝试使用发布方案来构建和运行我使用cli创建的main.jsbundle文件。这是我用来生成这个包的命令:
node_modules/react-native/local-cli/cli.js bundle --entry-file index.ios.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios
但是,当我在XCode上单击build and run按钮时,每次打包程序自动启动时,捆绑包都会正确生成!查看Products文件夹中Application的内容,我可以假设编译后的应用程序中使用的bundle是从打包程序生成的,而不是我使用bundle cli命令生成的。有没有办法在运行Release Scheme时抑制该打包程序的运行,并使用我生成的包?
发布于 2019-01-08 23:56:15
在xcode中打开应用程序
在/AppDelegate.m中
替换
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
使用
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
https://stackoverflow.com/questions/42210468
复制相似问题