From a72e5f4e55a2330ed01963b63cf0ab3e0309b524 Mon Sep 17 00:00:00 2001 From: Rahim Rahman Date: Wed, 13 Nov 2024 10:59:34 -0700 Subject: [PATCH] chore: patch getBuildSettings to allow run ios from cli --- ...-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 0000000000..2a688950b9 --- /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)}`);