Skip to content

Commit 9f28616

Browse files
Morritzfacebook-github-bot
authored andcommitted
Enhance IP address retrieval for iOS devices in Metro bundler setup (#41839)
Summary: After introducing this commit a56e5da script may fail in some circumstances. Example: When there is IP address available only for en1 and not en0, first "ipconfig" command in the loop fails with error code 1 and cancels whole script. ## Changelog: [iOS] [Fixed] - [enhance IP address retrieval for iOS devices in Metro bundler setup](6a351db) Pull Request resolved: #41839 Reviewed By: christophpurrer Differential Revision: D51979040 Pulled By: dmytrorykun fbshipit-source-id: 0f6f42a7dd70bac012875ffae5d651b74b225c94
1 parent 4a565e7 commit 9f28616

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-native/scripts/react-native-xcode.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ DEST=$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH
1515
# Enables iOS devices to get the IP address of the machine running Metro
1616
if [[ ! "$SKIP_BUNDLING_METRO_IP" && "$CONFIGURATION" = *Debug* && ! "$PLATFORM_NAME" == *simulator ]]; then
1717
for num in 0 1 2 3 4 5 6 7 8; do
18-
IP=$(ipconfig getifaddr en${num})
18+
IP=$(ipconfig getifaddr en${num} || echo "")
1919
if [ ! -z "$IP" ]; then
2020
break
2121
fi

0 commit comments

Comments
 (0)