Skip to content

Commit 062e964

Browse files
TomSwiftfacebook-github-bot
authored andcommitted
more accurate product-name regex
Summary: Some projects define multiple targets, including app extensions, which are built with a “.appex” extension. This fix prevents the buildProject method from selecting any app extension (e.g. a Today.appex today-widget extension) as the product name. Thanks for submitting a PR! Please read these instructions carefully: - [X] Explain the **motivation** for making this change. - [X] Provide a **test plan** demonstrating that the code is solid. - [X] Match the **code formatting** of the rest of the codebase. - [X] Target the `master` branch, NOT a "stable" branch. When building our workspace, ReactNative was failing to install the app to the simulator because it calculated an incorrect path to the app itself. It was attempting to install "Today.app" when it should have been installing "Remitly.app". I discovered that ReactNative parses the build output to identify the generated app name, and that this was broken when the build also generated an app extension. The f Closes facebook/react-native#13001 Differential Revision: D4735360 fbshipit-source-id: afeeb2073ccd65c95916b153fcde574b5343af8c
1 parent 0f740ce commit 062e964

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

runIOS/runIOS.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ function buildProject(xcodeProject, udid, scheme, configuration = 'Debug', launc
157157
});
158158
buildProcess.on('close', function(code) {
159159
//FULL_PRODUCT_NAME is the actual file name of the app, which actually comes from the Product Name in the build config, which does not necessary match a scheme name, example output line: export FULL_PRODUCT_NAME="Super App Dev.app"
160-
let productNameMatch = /export FULL_PRODUCT_NAME="?(.+).app/.exec(buildOutput);
160+
let productNameMatch = /export FULL_PRODUCT_NAME="?(.+).app"?$/.exec(buildOutput);
161161
if (productNameMatch && productNameMatch.length && productNameMatch.length > 1) {
162162
return resolve(productNameMatch[1]);//0 is the full match, 1 is the app name
163163
}

0 commit comments

Comments
 (0)