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
ReactNative 真机运行卡在Runing1 of 1 custom shell scripts_第1张图片
屏幕快照 2018-10-29 上午11.17.18.png

你可能感兴趣的:(ReactNative 真机运行卡在Runing1 of 1 custom shell scripts)