Skip to content

[build-tools] Install builds in simulator sessions - #4222

Merged
szdziedzic merged 7 commits into
mainfrom
szdziedzic-codex/simulator-build-source-build-tools
Aug 24, 2026
Merged

[build-tools] Install builds in simulator sessions#4222
szdziedzic merged 7 commits into
mainfrom
szdziedzic-codex/simulator-build-source-build-tools

Conversation

@szdziedzic

@szdziedzic szdziedzic commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Why

Follow up to https://github.com/expo/universe/pull/30191

Enable EAS Sim users to preinstall and start builds when starting sim session

How

Add/use eas/download_build, eas/install_build, and eas/launch_application steps to accomplish it.

Test Plan

Tests

@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.75630% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.82%. Comparing base (790231e) to head (f8bfa55).

Files with missing lines Patch % Lines
...s/build-tools/src/steps/functions/downloadBuild.ts 86.80% 6 Missing and 1 partial ⚠️
...es/build-tools/src/steps/functions/installBuild.ts 92.31% 3 Missing ⚠️
...ild-tools/src/steps/functions/launchApplication.ts 96.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4222      +/-   ##
==========================================
+ Coverage   63.76%   63.82%   +0.06%     
==========================================
  Files        1030     1032       +2     
  Lines       47497    47608     +111     
  Branches     9993    10022      +29     
==========================================
+ Hits        30280    30379      +99     
- Misses      17116    17126      +10     
- Partials      101      103       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@szdziedzic
szdziedzic requested a review from sjchmiela August 19, 2026 13:58
@szdziedzic
szdziedzic force-pushed the szdziedzic-codex/simulator-build-source-build-tools branch from cfdb8f7 to aec8737 Compare August 24, 2026 10:45
@szdziedzic
szdziedzic marked this pull request as ready for review August 24, 2026 10:54
Comment thread packages/build-tools/src/steps/functions/downloadBuild.ts Outdated
Comment thread packages/build-tools/src/steps/functions/downloadBuild.ts Outdated
Comment on lines +82 to +87
const infoPlistPath = path.join(artifactPath, 'Info.plist');
const { stdout } = await spawn(
'plutil',
['-extract', 'CFBundleIdentifier', 'raw', '-o', '-', infoPlistPath],
{ stdio: 'pipe', env }
);

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.

i wonder if we should unify this with

export async function readIpaInfoAsync(ipaPath: string): Promise<IpaInfo> {
somehow (or at least add readIosAppInfo or sth

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agree that a shared iOS application metadata abstraction would be cleaner. I’d prefer to handle that as a follow-up so this PR stays focused on the install/launch primitives.

}

logger.info(`Installing ${artifactPath} on the iOS Simulator.`);
await spawn('xcrun', ['simctl', 'install', 'booted', artifactPath], { env, logger });

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.

technically it would be nice to add support for:

  • device identifier to install the app on
  • multiple booted devices

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agree this would be useful. I’d like to add it separately once we define whether the function accepts one device identifier or supports installing on multiple devices. The current remote-session use case has one booted target.

Comment on lines +102 to +105
throw new UserError(
'EAS_INSTALL_BUILD_INVALID_ARTIFACT',
'Android Emulator sessions require an .apk build artifact.'
);

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.

would be nice to add support for converting aab to apk on the fly

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agree this would be useful. I think AAB conversion should be an explicit composable function rather than hidden inside install_build because it also requires bundletool and signing decisions. I’ll treat it as follow-up scope.

Comment thread packages/build-tools/src/steps/functions/installBuild.ts Outdated
}

logger.info(`Installing ${artifactPath} on the Android Emulator.`);
await spawn('adb', ['install', '-r', artifactPath], { env, logger });

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.

what does -r do?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

-r reinstalls/replaces an already installed application while preserving its existing app data - just in case

Comment thread packages/build-tools/src/steps/functions/launchApplication.ts Outdated
Comment thread packages/build-tools/src/steps/functions/downloadBuild.ts Outdated
@github-actions

Copy link
Copy Markdown

✅ Thank you for adding the changelog entry!

@szdziedzic
szdziedzic merged commit 1fe8f24 into main Aug 24, 2026
11 checks passed
@szdziedzic
szdziedzic deleted the szdziedzic-codex/simulator-build-source-build-tools branch August 24, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants