Skip to content

Add emulator and Android browsers to autowebcompat tools - #7495

Open
ksy36 wants to merge 5 commits into
masterfrom
ksy36/autowebcompat-android-emulator
Open

ksy36 wants to merge 5 commits into
masterfrom
ksy36/autowebcompat-android-emulator

Conversation

@ksy36

@ksy36 ksy36 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Added an android-agent Docker build target with the Android SDK and a google_apis x86_64 emulator.
Also added a helper android_emulator.py, which boots the emulator, waits for it, wraps adb, and optionally captures logcat.

@ksy36
ksy36 changed the base branch from master to ksy36/autowebcompat-shared-mcp November 13, 2026 21:50
@ksy36
ksy36 added this pull request to stack #7493 November 13, 2026 21:50
@ksy36
ksy36 force-pushed the ksy36/autowebcompat-android-emulator branch 3 times, most recently from 3df2265 to 450c0f4 Compare November 16, 2026 03:57
@ksy36
ksy36 marked this pull request as ready for review November 16, 2026 04:47
@ksy36
ksy36 requested a review from a team as a code owner November 16, 2026 04:47
devices:
- /dev/kvm:/dev/kvm
group_add:
- "${KVM_GID:?Set KVM_GID to the group ID owning /dev/kvm}"

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.

I tested this in a gcp vm with nested virtualization enabled:

KVM_GID=$(stat -c %g /dev/kvm) BUG_ID=2085742 RUN_ID=2085742-android-1 docker compose -f agents/autowebcompat-repro/compose.yml -f agents/autowebcompat-repro/compose.android.yml up --build --force-recreate --abort-on-container-exit

We discussed that on production we'll need to use Cloud Batch instead of Cloud Run, so this depends on #6638.

@ksy36
ksy36 requested a review from suhaibmujahid November 16, 2026 05:28
@ksy36
ksy36 force-pushed the ksy36/autowebcompat-android-emulator branch from 450c0f4 to 6d30443 Compare November 16, 2026 05:33
@ksy36
ksy36 requested a review from jgraham November 16, 2026 05:44
@ksy36
ksy36 force-pushed the ksy36/autowebcompat-android-emulator branch 2 times, most recently from c4670ba to 3f46c40 Compare November 16, 2026 15:01
Base automatically changed from ksy36/autowebcompat-shared-mcp to master November 16, 2026 16:39
@ksy36
ksy36 force-pushed the ksy36/autowebcompat-android-emulator branch 3 times, most recently from 9748c93 to 90aa649 Compare November 16, 2026 21:35
printf 'disk.dataPartition.size=12G\nhw.ramSize=8192\nhw.keyboard=no\n' \
>> "$ANDROID_AVD_HOME/webcompat.avd/config.ini"

FROM android-base AS android-agent

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this temporary, for local testing only, with the plan to replace agent with android-agent once we have Cloud Batch support?

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.

yes, I was thinking to rename android-agent to agent (and the current agent becomes something like desktop-agent). I kept them as separate targets so we don't build the Android image until it's supported

@jgraham jgraham left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

My high level question is how we handle android emulator crashes (or otherwise the emulator getting into a bad state); experience suggests that this isn't very unlikely. Making the emulator a separate service that the agent harness can't restart if needed is likely to cause some frustrating problems down the line.

Comment thread agents/autowebcompat-repro/Dockerfile Resolved
@@ -0,0 +1,153 @@
import logging

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did we consider using mozdevice rather than rewriting much of the same code here? I'm aware that there are a bunch of edge cases that we've figured out from experience that new code is unlikely to cover.

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.

Good call, I've switched it to use mozdevice instead.

@@ -0,0 +1,153 @@
import logging

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did we consider using mozdevice rather than rewriting much of the same code here? I'm aware that there are a bunch of edge cases that we've figured out from experience that new code is unlikely to cover.

@ksy36
ksy36 requested a review from a team as a code owner December 1, 2026 19:29
@ksy36
ksy36 force-pushed the ksy36/autowebcompat-android-emulator branch from 2c0de97 to 201b0ac Compare December 1, 2026 20:09

This branch has not been deployed

No deployments
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.

3 participants