Repository navigation
[eas-build-job][build-tools] Check Android launch inputs before the session starts - #4696
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4696 +/- ##
==========================================
+ Coverage 75.30% 75.31% +0.01%
==========================================
Files 1053 1053
Lines 52170 52181 +11
Branches 11356 11398 +42
==========================================
+ Hits 39281 39293 +12
+ Misses 11901 11900 -1
Partials 988 988 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Agent-device sessions checked Android launch inputs only when launching, after the emulator booted and the build installed. Check NUL characters and the command length at the start of the step, as on iOS, leaving room for the launch component that is only known after install.
Move the Android shell quoting and the early launch input checks into @expo/eas-build-job, so www can check launch inputs when a session is created, for every session type.
…nd early Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
brentvatne
force-pushed
the
@brent/android-launch-arg-early-validation
branch
from
October 20, 2026 04:30
eb6d150 to
8aabf49
Compare
|
✅ Thank you for adding a changeset! |
AndrewSouthpaw
added a commit
to AndrewSouthpaw/eas-cli
that referenced
this pull request
Oct 22, 2026
…t-dirs * upstream/main: (128 commits) [build-tools] stop logging workflow hook parsing in build logs (expo#4717) [build-tools] retry download_build network failures and report their cause (expo#4690) [eas-cli][build-tools] Bump Node.js to 22.23.4 (expo#4714) [eas-cli] make command descriptions lowercase without trailing periods (expo#4385) [build-tools] Add `max_duration_seconds` to sandboxes (expo#4702) [eas-cli] Show simulator session errors in simulator:get (expo#4694) [eas-cli] Show why a simulator session failed to start (expo#4693) [worker] Mask secrets in every field of uploaded log records (expo#4698) [eas-build-job][build-tools] Check Android launch inputs before the session starts (expo#4696) bump STAGING and PRODUCTION to 25.3.0 in cli-versions.json v25.3.0 [eas-cli] Add --system-image to eas simulator:start (expo#4500) [build-tools] Wait up to five minutes for Google Play to process an uploaded bundle (expo#4700) [build-tools] Quote Android launch arguments for the device shell (expo#4695) [build-tools] Forward network capture through local egress (expo#4598) [build-tools] Let serve-sim start the iOS Simulator for Appium (expo#4603) [build-tools] Let serve-sim start the iOS Simulator for Argent (expo#4602) [build-tools] Upload iOS Simulator session screen recording metadata (expo#4689) [build-tools] Reset the session idle timer on serve-sim preview input (expo#4691) [eas-cli] Add a checkout prompt experiment to the Free plan build limit error (expo#4633) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows #4695 (merged), which added the Android shell quoting and the checks this PR moves earlier.
Why
On iOS, agent-device sessions validate launch inputs at the start of the step (
validateServeSimLaunchOptions). On Android, launch inputs were only checked insidelaunchApplicationAsync, which runs after the emulator boots, the build downloads and the app installs. Input that can never work, such as a NUL character or a command too long for adb, therefore failed about a minute into a billed session.Nothing in #4263 or #4324 says this was deliberate. #4324 made the up-front check iOS-only because it guards serve-sim's own limits, and Android never got an equivalent.
The check doesn't depend on the controller, so it belongs in
@expo/eas-build-job. www can then run it when a session is created, for every session type and client, before any job starts.How
@expo/eas-build-jobnow exports, fromdeviceRunSession.ts:quoteAndroidShellCommand: the quoting from [build-tools] Quote Android launch arguments for the device shell #4695, plus the NUL and 65,000-byte checks. It measures bytes withTextEncoder, so it doesn't need Node'sBuffer.validateAndroidLaunchOptions({ launchArgs, openUrl }): runs those checks before the launch component (<package>/<activity>) is known. It measures the command without the component, so it rejects only commands that can never launch, and the launch still checks the exact command.launchApplication.tsnow usesquoteAndroidShellCommandfrom@expo/eas-build-jobinstead of its own copy. The launch still checks the exact command.startAgentDeviceSessioncallsvalidateAndroidLaunchOptionsnext to the iOS check, so agent-device sessions fail before the emulator boots.@expo/eas-build-jobbump includes this, callvalidateAndroidLaunchOptionsinvalidateApplicationLaunchOptionsfor Android sessions. That covers argent and Appium sessions too. They only receive launch inputs in the latereas/launch_applicationstep, so until then they check at launch.Test Plan
eas-build-job'sdeviceRunSession.test.ts:startAgentDeviceSession.test.ts: a NUL argument, a NUL URL and an oversized command each fail before the emulator starts, the build downloads or the session starts. With the call removed, all three fail.@expo/build-toolsunit suite passes (2,438 tests), and so doyarn typecheck,yarn lintandyarn fmt:check.🤖 Generated with Claude Code