ReactNative 真机运行卡在Runing1 of 1 custom shell scripts

Xcode真机运行ReactNative项目一直卡在Runing1 of 1 custom shell scripts问题

8588F967F8911EEA887A1AFAA95D712B.png
原因

就是react-native-xcode.sh. 每次打包安装都重新把RN文件打包成main.jsbundle, 在机械硬盘的渣渣电脑上操作那数以万计个的文件,所以会很慢

解决

Build Phases

Bundle React Native code and images

export NODE_BINARY=node
../node_modules/react-native/scripts/react-native-xcode.sh

上方添加

if [ "$CONFIGURATION" = "Debug" ]; then
  echo "--- Skip bundle building in 'Debug' mode"
  exit 0
fi

或者

DEST=$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH

if [ "$CONFIGURATION" = "Debug" ] && [ -f "$DEST/main.jsbundle" ]; then
  echo "--- Skip bundle building in 'Debug' mode"
  exit 0
fi
if [ "$CONFIGURATION" = "Debug" ]; then
echo "--- Skip bundle building in 'Debug' mode"
exit 0
fi
export NODE_BINARY=node
../node_modules/react-native/scripts/react-native-xcode.sh
屏幕快照 2018-10-29 上午11.17.18.png
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容