Skip to content

Add Android Maestro CI launcher#7

Closed
riderx wants to merge 1 commit intocodex/maestro-ci-runners-greenfrom
codex/android-maestro-ci-launcher
Closed

Add Android Maestro CI launcher#7
riderx wants to merge 1 commit intocodex/maestro-ci-runners-greenfrom
codex/android-maestro-ci-launcher

Conversation

@riderx
Copy link
Copy Markdown
Member

@riderx riderx commented Apr 8, 2026

What

  • add a dedicated example-app Android Maestro CI launcher
  • make Android emulator setup deterministic by using explicit SDK tool paths and a fallback AVD creation path
  • document the new entrypoint in the example app README

Why

  • ./scripts/run-maestro-android-ci.sh was failing with yes: standard output: Broken pipe and Failed to install a compatible Android system image
  • the previous flow depended too much on Maestro's device bootstrap and local PATH state, which made CI and local Android runs fragile

How

  • add example-app/scripts/run-maestro-android-ci.sh
  • reuse an already booted device when available
  • otherwise pick an existing local AVD, or create a supported Android 33 google_apis emulator when none exists
  • replace yes | sdkmanager style piping with a bounded printf license acceptance flow
  • build the plugin and example app, sync Android, assemble the debug APK, install it, then hand off to the existing Maestro runner

Testing

  • ran cd example-app && MAESTRO_ANDROID_PREPARE_ONLY=1 ./scripts/run-maestro-android-ci.sh
  • verified it booted the emulator, built the plugin, synced Android, assembled the debug APK, and installed the app successfully

Not Tested

  • full GitHub Actions execution for this new branch is still pending
  • no iOS behavior changes are included in this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 61fe7286-917e-4e60-b666-6de6b2d61fc5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/android-maestro-ci-launcher

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7c77a8c25b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +10 to +11
SDKMANAGER_BIN="${SDKMANAGER_BIN:-$SDK_ROOT/tools/bin/sdkmanager}"
AVDMANAGER_BIN="${AVDMANAGER_BIN:-$SDK_ROOT/tools/bin/avdmanager}"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use valid default paths for sdkmanager and avdmanager

These defaults point to $SDK_ROOT/tools/bin/..., but modern Android SDK installs provide both tools under cmdline-tools/<version>/bin instead. On a clean machine/CI runner with no pre-existing AVD, the fallback path (create_default_avd / ensure_system_image) will fail with “not available” before it can create an emulator, so maestro:android:ci cannot bootstrap itself as documented unless callers manually override both env vars.

Useful? React with 👍 / 👎.


export ANDROID_SERIAL="$BOOTED_DEVICE_ID"
cd "$ROOT_DIR"
exec ./scripts/run-maestro-android.sh
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve EXIT cleanup when handing off to Maestro runner

Using exec here replaces the current shell process, so the registered trap cleanup EXIT in this script never runs on the success path. When this launcher starts its own emulator, that leaves the emulator process running after Maestro finishes/fails, which can leak resources and affect subsequent local or CI runs that expect this script to tear down what it started.

Useful? React with 👍 / 👎.

@riderx
Copy link
Copy Markdown
Member Author

riderx commented Apr 13, 2026

Superseded by #8, which targets main and replaces this stacked intermediate PR.

@riderx riderx closed this Apr 13, 2026
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.

1 participant