From 13cb9c0a0a85b92177c2315793083629cfafd61f Mon Sep 17 00:00:00 2001 From: Rahim Rahman Date: Wed, 13 Nov 2024 12:48:17 -0700 Subject: [PATCH] chore: patch getBuildSettings to allow run ios from cli (#8345) --- ...-community+cli-platform-apple+13.6.9.patch | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 patches/@react-native-community+cli-platform-apple+13.6.9.patch diff --git a/patches/@react-native-community+cli-platform-apple+13.6.9.patch b/patches/@react-native-community+cli-platform-apple+13.6.9.patch new file mode 100644 index 00000000000..2a688950b96 --- /dev/null +++ b/patches/@react-native-community+cli-platform-apple+13.6.9.patch @@ -0,0 +1,22 @@ +diff --git a/node_modules/@react-native-community/cli-platform-apple/build/commands/runCommand/getBuildSettings.js b/node_modules/@react-native-community/cli-platform-apple/build/commands/runCommand/getBuildSettings.js +index 147bb53..b7cb80c 100644 +--- a/node_modules/@react-native-community/cli-platform-apple/build/commands/runCommand/getBuildSettings.js ++++ b/node_modules/@react-native-community/cli-platform-apple/build/commands/runCommand/getBuildSettings.js +@@ -31,10 +31,16 @@ async function getBuildSettings(xcodeProject, mode, buildOutput, scheme, target) + encoding: 'utf8' + }); + const settings = JSON.parse(buildSettings); ++ const fistIndexForAppTarget = Math.max( ++ 0, ++ settings.findIndex(({ ++ buildSettings: bs ++ }) => bs.WRAPPER_EXTENSION === 'app') ++ ); + const targets = settings.map(({ + target: settingsTarget + }) => settingsTarget); +- let selectedTarget = targets[0]; ++ let selectedTarget = targets[fistIndexForAppTarget]; + if (target) { + if (!targets.includes(target)) { + _cliTools().logger.info(`Target ${_chalk().default.bold(target)} not found for scheme ${_chalk().default.bold(scheme)}, automatically selected target ${_chalk().default.bold(selectedTarget)}`);