Skip to content

Commit 6b550a2

Browse files
cipolleschifacebook-github-bot
authored andcommitted
Fix E2E test script when the ci flag is not specified (#52617)
Summary: Pull Request resolved: #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](#52609) ## Changelog: [Internal] - Reviewed By: vzaidman Differential Revision: D78344397 fbshipit-source-id: cf2d9c032966a9be05670259e9532789829349f2
1 parent 339dc49 commit 6b550a2

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

scripts/release-testing/test-release-local.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,26 @@ async function testRNTesterIOS(
113113

114114
// install app on device
115115
exec(`xcrun simctl install booted ${appOutputFolder}`);
116-
117-
// launch the app on iOS simulator
118-
exec('xcrun simctl launch booted com.meta.RNTester.localDevelopment');
119116
} else {
120117
exec(
121118
`USE_HERMES=1 CI=${onReleaseBranch.toString()} RCT_NEW_ARCH_ENABLED=1 bundle exec pod install --ansi`,
122119
);
123120

124-
// launch the app on iOS simulator
121+
// build the app on iOS simulator
122+
exec(
123+
'xcodebuild -workspace RNTesterPods.xcworkspace -scheme RNTester -sdk "iphonesimulator" -destination "generic/platform=iOS Simulator" -derivedDataPath "/tmp/RNTesterBuild"',
124+
);
125+
// boot device
126+
exec('xcrun simctl boot "iPhone 16 Pro"');
127+
// install app on device
125128
exec(
126-
'npx react-native run-ios --scheme RNTester --simulator "iPhone 15 Pro"',
129+
'xcrun simctl install booted "/tmp/RNTesterBuild/Build/Products/Debug-iphonesimulator/RNTester.app"',
127130
);
131+
// bring iOS simulator to the front
132+
exec('open -a simulator');
128133
}
134+
// launch the app on iOS simulator
135+
exec('xcrun simctl launch booted com.meta.RNTester.localDevelopment');
129136
}
130137

131138
/**

0 commit comments

Comments
 (0)