Skip to content

Add EAS Build cloud fallback to native_build for Android when local SDK is unavailable #31

Description

@vincentvella

Problem

native_build({ platform: "android" }) currently runs expo run:android, which requires a local Android SDK, adb, and a booted emulator. On developer machines without the Android SDK installed (a common setup for web-focused contributors, CI environments, or M-series Macs without full Android tooling), the build fails immediately with no useful fallback.

The README "Where to take it next" explicitly flags this gap: "an eas build fallback when there's no local native toolchain".

By contrast, iOS has a natural local path (Xcode + Simulator on macOS), so this gap is Android-specific.

Proposed Approach

Extend native_build with an optional mode parameter (or auto-detect):

native_build({ platform: "android", mode?: "local" | "eas" | "auto" })
  • "local" (current behavior) — runs expo run:android; fails fast with a clear message if adb / SDK is absent.
  • "eas" — runs eas build --platform android --profile development (or --profile preview), streaming output to the timeline. Requires eas-cli to be installed (npx eas-cli as fallback).
  • "auto" (default) — probe for adb / a booted device first; fall back to eas if absent, surfacing a clear message explaining the switch.

The Settings → native readiness preflight (currently iOS+Android SDK checks) should surface EAS CLI availability alongside SDK presence so the agent and user know which path will be taken.

Streaming output should land on the timeline the same way expo run:android output does today (same native source, same dev_start-style line-by-line tee).

Affected Files

  • src/toolSpecs.ts — extend native_build schema with mode param
  • src/toolLayer.tsnative_build handler logic
  • src/reactNativeController.ts — Android build orchestration
  • cockpit/main.ts — native readiness preflight UI integration

Metadata

Metadata

Assignees

Labels

enhancementNew feature or improvement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions