From b1b0cdb38654e71c86c71ae80d15670154856e18 Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Sat, 9 Dec 2023 13:35:18 +0100 Subject: [PATCH] fix: Fix iOS build error when `en0` is not available Fixes a build error that happens when trying to find the host IP address. e.g. when `ipconfig getifaddr en0` fails, it fails the build, even though `en1` would've worked successfully. --- packages/react-native/scripts/react-native-xcode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/scripts/react-native-xcode.sh b/packages/react-native/scripts/react-native-xcode.sh index c34ea666d782..f37fa78fa5cb 100755 --- a/packages/react-native/scripts/react-native-xcode.sh +++ b/packages/react-native/scripts/react-native-xcode.sh @@ -15,7 +15,7 @@ DEST=$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH # Enables iOS devices to get the IP address of the machine running Metro if [[ ! "$SKIP_BUNDLING_METRO_IP" && "$CONFIGURATION" = *Debug* && ! "$PLATFORM_NAME" == *simulator ]]; then for num in 0 1 2 3 4 5 6 7 8; do - IP=$(ipconfig getifaddr en${num}) + IP=$(ipconfig getifaddr en${num} || true) if [ ! -z "$IP" ]; then break fi