Xcode真機(jī)運(yùn)行ReactNative項(xiàng)目一直卡在Runing1 of 1 custom shell scripts問題
8588F967F8911EEA887A1AFAA95D712B.png
原因
就是react-native-xcode.sh. 每次打包安裝都重新把RN文件打包成main.jsbundle, 在機(jī)械硬盤的渣渣電腦上操作那數(shù)以萬計(jì)個(gè)的文件,所以會(huì)很慢
解決
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