Skip to content

Add an Android CLI multi-run snapshot job - #27

Merged
jpcottin merged 1 commit into
mainfrom
ci/android-cli-multirun
Jul 27, 2026
Merged

Add an Android CLI multi-run snapshot job#27
jpcottin merged 1 commit into
mainfrom
ci/android-cli-multirun

Conversation

@jpcottin

Copy link
Copy Markdown
Owner

What

The same four-cycle snapshot experiment as emulator-preview-multirun, driven entirely by the Android CLI — emulator start / stop, run, screen capture, layout.

android emulator start uses the SDK's emulator package and cannot target emulators/latest, so this exercises the canary emulator. That is the point: the two multi-run jobs together show how the same experiment behaves on each emulator. It's an add, not a replacement.

Prototyped locally first

Four cycles on this machine before writing any YAML. What that established:

  • android emulator stop writes the default_boot snapshot and a plain android emulator start loads it. Confirmed by Loading snapshot 'default_boot'... in the emulator log, and by start times of ~5s for cycles 2-4 against ~20s for the initial cold boot.
  • No --cold is needed anywhere. A freshly created AVD boots cold by itself, and every later cycle must load the snapshot.
  • A Vulkan app might not always survive on snapshot load before emulator 37.2.x — it depends on which Vulkan features are in use. So the job never relaunches the app after a restore: doing so would hide the very thing being measured. It also only drives input while the app is actually running, so it can't tap a home screen and launch something at random.
  • android layout returns an empty tree for a NativeActivity, which has no view hierarchy. It's captured anyway, because it's the liveness signal intended for the View/Compose apps — and it did return a full tree for the launcher, so the command works, just not against a raw Vulkan surface.

Output

Each cycle logs app survived restore: YES/NO, and the run ends by grepping the emulator log for snapshot activity — so the outcome is readable from the job log rather than inferred from images. Screenshots (entry and exit per cycle), layout dumps, logcat and the emulator log are uploaded.

Runs headless under Xvfb, as the existing CLI job does — which also keeps stray host input out of the guest.

Non-blocking, like the other emulator experiments.

Runs the same four-cycle snapshot experiment as emulator-preview-multirun,
but driven entirely by the Android CLI: emulator start/stop, run, screen
capture and layout. `android emulator start` uses the SDK's emulator package
and cannot target emulators/latest, so this exercises the canary emulator --
the two jobs together show how the same experiment behaves on each.

Prototyped locally first. What that established:

- `android emulator stop` writes the default_boot snapshot and a plain
  `android emulator start` loads it. Confirmed by "Loading snapshot
  'default_boot'" in the emulator log and by start times of ~5s against
  ~20s for the initial cold boot.
- No --cold is needed anywhere: a freshly created AVD boots cold by itself,
  and every later cycle must load the snapshot.
- A Vulkan app might not always survive on snapshot load before emulator
  37.2.x; it depends on which Vulkan features are in use. The job therefore
  never relaunches the app after a restore -- doing so would hide what is
  being measured -- and only drives input while the app is actually running,
  so it cannot tap a home screen at random.
- `android layout` returns an empty tree for a NativeActivity, which has no
  view hierarchy. It is still captured, because it is the liveness signal
  intended for View/Compose apps, where it does return a full tree.

The job logs an explicit "app survived restore: YES/NO" per cycle and greps
the emulator log for snapshot activity, so the outcome is readable from the
job log rather than inferred from screenshots. Non-blocking, like the other
emulator experiments.
@jpcottin
jpcottin merged commit 9258150 into main Jul 27, 2026
13 of 14 checks passed
@jpcottin
jpcottin deleted the ci/android-cli-multirun branch July 27, 2026 00:25
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