From 6b550a279ededd2d88b558fcda769aa6db2ee83a Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Tue, 15 Jul 2025 12:04:20 -0700 Subject: [PATCH] Fix E2E test script when the ci flag is not specified (#52617) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52617 The `test-release-local` script was failing to execute the npx rreact-native run-ios command for some issues with cocoapods. That command tries to reinstall the pods so there might be some issues when testing. As an alternative, we can avoid duplicated work by dropping the npx react-native command and, instead, build the app with xcodebuild and install it in the simulator with xcrun. This is a backport of [this PR](https://github.com/facebook/react-native/pull/52609) ## Changelog: [Internal] - Reviewed By: vzaidman Differential Revision: D78344397 fbshipit-source-id: cf2d9c032966a9be05670259e9532789829349f2 --- scripts/release-testing/test-release-local.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/scripts/release-testing/test-release-local.js b/scripts/release-testing/test-release-local.js index df3db66297c..8c568e94105 100644 --- a/scripts/release-testing/test-release-local.js +++ b/scripts/release-testing/test-release-local.js @@ -113,19 +113,26 @@ async function testRNTesterIOS( // install app on device exec(`xcrun simctl install booted ${appOutputFolder}`); - - // launch the app on iOS simulator - exec('xcrun simctl launch booted com.meta.RNTester.localDevelopment'); } else { exec( `USE_HERMES=1 CI=${onReleaseBranch.toString()} RCT_NEW_ARCH_ENABLED=1 bundle exec pod install --ansi`, ); - // launch the app on iOS simulator + // build the app on iOS simulator exec( - 'npx react-native run-ios --scheme RNTester --simulator "iPhone 15 Pro"', + 'xcodebuild -workspace RNTesterPods.xcworkspace -scheme RNTester -sdk "iphonesimulator" -destination "generic/platform=iOS Simulator" -derivedDataPath "/tmp/RNTesterBuild"', ); + // boot device + exec('xcrun simctl boot "iPhone 16 Pro"'); + // install app on device + exec( + 'xcrun simctl install booted "/tmp/RNTesterBuild/Build/Products/Debug-iphonesimulator/RNTester.app"', + ); + // bring iOS simulator to the front + exec('open -a simulator'); } + // launch the app on iOS simulator + exec('xcrun simctl launch booted com.meta.RNTester.localDevelopment'); } /**