Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xcode 使用main.jsbundle在React Native中构建并运行发布方案_Xcode_React Native - Fatal编程技术网

Xcode 使用main.jsbundle在React Native中构建并运行发布方案

Xcode 使用main.jsbundle在React Native中构建并运行发布方案,xcode,react-native,Xcode,React Native,反应本机:0.41.2 问题是,我试图使用发布方案构建和运行main.jsbundle文件,该文件是我使用cli创建的。这是我用来生成该捆绑包的命令: 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上单击buil

反应本机:0.41.2

问题是,我试图使用发布方案构建和运行main.jsbundle文件,该文件是我使用cli创建的。这是我用来生成该捆绑包的命令:

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文件夹中应用程序的内容,我可以假设编译后的应用程序中使用的捆绑包是从packager生成的,而不是我使用bundle cli命令生成的。在运行发布方案并使用生成的捆绑包时,是否有某种方法可以抑制正在运行的此打包程序?

在xcode中打开应用程序

in/AppDelegate.m

替换

jsCodeLocation=[[RCTBundleURLProvider sharedSettings]jsBundleURLForBundleRoot:@“index”fallbackResource:nil]

jsCodeLocation=[[NSBundle mainBundle]URLForResource:@“main”带扩展名:@“jsbundle”]