Skip to content

fix: produce IPA for BrowserStack iOS builds instead of simulator app#30245

Open
cmd-ob wants to merge 2 commits into
mainfrom
fix/browserstack-ios-ipa-build
Open

fix: produce IPA for BrowserStack iOS builds instead of simulator app#30245
cmd-ob wants to merge 2 commits into
mainfrom
fix/browserstack-ios-ipa-build

Conversation

@cmd-ob
Copy link
Copy Markdown
Contributor

@cmd-ob cmd-ob commented May 15, 2026

Summary

  • The main-e2e-bs-with-srp and main-e2e-bs-without-srp build configs use METAMASK_ENVIRONMENT='e2e', which causes build.sh to internally load main-e2e via loadBuildConfig
  • main-e2e has IS_SIM_BUILD: 'true', so the build produces a simulator .app instead of an IPA
  • rename-artifacts.js reads IS_SIM_BUILD from the GH Actions env (set from main-e2e-bs-* which has no IS_SIM_BUILD), so it looks for an IPA that doesn't exist → upload fails with "Input required and not supplied: path"
  • BrowserStack App Automate requires a real IPA for device testing

Fix

  • Add main-e2e-bs base config (same env vars as the bs variants but without IS_SIM_BUILD)
  • Point main-e2e-bs-with-srp and main-e2e-bs-without-srp at it via script_name: main-e2e-bs
  • Add build:ios:main:e2e:bs and build:android:main:e2e:bs yarn scripts calling build.sh with e2e-bs
  • Add e2e-bs to the valid environments list in build.sh

This makes loadBuildConfig load main-e2e-bs (no IS_SIM_BUILD) instead of main-e2e (IS_SIM_BUILD: 'true'), resulting in a device build that produces an IPA.

Test plan

  • Trigger Build iOS Dual Versions and Upload to BrowserStack workflow on this branch
  • Verify both with-SRP and without-SRP builds produce ios-ipa-main-e2e-bs-* artifacts
  • Verify IPAs are successfully uploaded to BrowserStack

🤖 Generated with Claude Code


Note

Medium Risk
Changes CI/build configuration selection for BrowserStack E2E builds and introduces a new e2e-bs environment, which could affect build outputs and workflow expectations if any pipelines still assume e2e.

Overview
Ensures BrowserStack E2E builds use a dedicated build configuration that produces device artifacts (IPA/APK) instead of simulator .app outputs.

Adds a new main-e2e-bs build config in builds.yml (BrowserStack/performance flags without IS_SIM_BUILD), updates the build:*:e2e:bs:* yarn scripts to call build.sh with e2e-bs, and extends scripts/build.sh environment validation to allow e2e-bs.

Reviewed by Cursor Bugbot for commit 45e9884. Bugbot is set up for automated code reviews on this repo. Configure here.

The main-e2e-bs-with-srp and main-e2e-bs-without-srp build configs use
METAMASK_ENVIRONMENT='e2e', which causes build.sh to internally load the
main-e2e config via loadBuildConfig. Since main-e2e has IS_SIM_BUILD='true',
the build produces a simulator .app instead of an IPA — but the BrowserStack
upload workflow expects an IPA for real-device testing.

Fix: introduce a main-e2e-bs base config (identical to main-e2e-bs-without-srp
but without IS_SIM_BUILD) and point both bs variants to it via script_name.
Add build:ios:main:e2e:bs and build:android:main:e2e:bs yarn scripts that
call build.sh with 'e2e-bs', triggering loadBuildConfig to load main-e2e-bs
instead of main-e2e, resulting in a device build that produces an IPA.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cmd-ob cmd-ob requested a review from a team as a code owner May 15, 2026 12:30
@github-actions
Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbotv2 metamaskbotv2 Bot added the team-qa QA team label May 15, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 92%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are purely build infrastructure:

  1. package.json: Fixes npm scripts build:android:main:e2e:bs:with:srp, build:android:main:e2e:bs:without:srp, build:ios:main:e2e:bs:with:srp, build:ios:main:e2e:bs:without:srp to use the new e2e-bs environment instead of the generic e2e environment.

  2. builds.yml: Adds a new main-e2e-bs build configuration specifically for BrowserStack App Automate (real device builds). Key flags: IS_BROWSERSTACK_BUILD=true, IS_PERFORMANCE_TEST=true, E2E_MOCK_OAUTH=true, RAMP_INTERNAL_BUILD=true. Critically, IS_SIM_BUILD is intentionally omitted so the build produces a device IPA/APK (not a simulator build) required for BrowserStack.

  3. scripts/build.sh: Adds e2e-bs as a valid METAMASK_ENVIRONMENT value in the validation case statement.

None of these changes affect:

  • App source code or UI components
  • Detox E2E test files or test logic
  • Simulator build configurations (still use e2e)
  • Any shared components (Browser, TabBar, Modals, Confirmations)

The changes only affect the BrowserStack device build pipeline. No Detox E2E tests are needed to validate these build script/config changes. The IS_PERFORMANCE_TEST flag in the new build config is for BrowserStack/wdio performance tests (a separate test framework), not Detox tests.

Performance Test Selection:
While the new main-e2e-bs build config includes IS_PERFORMANCE_TEST=true and is designed for BrowserStack performance testing, the changes here are purely to the build infrastructure (build scripts, build config YAML, npm scripts). No app source code was changed that would affect performance metrics. The performance tests themselves (wdio-based, running on BrowserStack) are a separate framework from Detox and are not triggered by these build config changes alone. The build infrastructure fix enables performance tests to run correctly on BrowserStack, but doesn't require performance test validation of the build scripts themselves.

View GitHub Actions results

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 45e9884. Configure here.

Comment thread builds.yml
IS_PERFORMANCE_TEST: 'true'
RAMP_INTERNAL_BUILD: 'true'
secrets: *secrets
code_fencing: *code_fencing_main
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BrowserStack override prevents device build from producing IPA

High Severity

The new main-e2e-bs config correctly omits IS_SIM_BUILD, but the existing BrowserStack override at build.sh line 948 sets IS_SIM_BUILD="false" for all BrowserStack builds. In generateIosBinary, the device build condition at line 451 uses [ -z "$IS_SIM_BUILD" ], which tests for an empty string — the string "false" has length 5, so -z returns false. With IS_DEVICE_BUILD also unset, neither the simulator nor device build block executes, producing no IPA at all. The override needs to unset IS_SIM_BUILD instead of setting it to "false", or be removed entirely now that main-e2e-bs no longer sets IS_SIM_BUILD.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 45e9884. Configure here.

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant