Xcode真机运行ReactNative项目一直卡在Runing1 of 1 custom shell scripts问题
原因
就是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