diff --git a/scripts/react-native-xcode.sh b/scripts/react-native-xcode.sh index 65404cc6864260..d684e89f8dc99d 100755 --- a/scripts/react-native-xcode.sh +++ b/scripts/react-native-xcode.sh @@ -53,9 +53,11 @@ esac # Path to react-native folder inside node_modules REACT_NATIVE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +# The project should be located next to where react-native is installed +# in node_modules. +PROJECT_ROOT=${PROJECT_ROOT:-"$REACT_NATIVE_DIR/../.."} -# Xcode project file for React Native apps is located in ios/ subfolder -cd "${REACT_NATIVE_DIR}"/../.. +cd $PROJECT_ROOT # Define NVM_DIR and source the nvm.sh setup script [ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.nvm"