Skip to content

Reduce owned Android AVD storage - #93

Merged
janicduplessis merged 1 commit into
mainfrom
codex/issue-83-android-storage
Aug 29, 2026
Merged

Reduce owned Android AVD storage#93
janicduplessis merged 1 commit into
mainfrom
codex/issue-83-android-storage

Conversation

@janicduplessis

Copy link
Copy Markdown
Collaborator

Description

Owned Android AVDs can consume several GB, but stim-cli currently lets the emulator persist Quick Boot snapshots and gc lists reclaimable AVDs without showing their footprint. This addresses the parts of #83 that do not require choosing an unmeasured data-partition size.

Solution

Owned AVD launches now pass -no-snapshot-save and -no-snapshot-load, so they neither persist nor restore Quick Boot state. Restarts are deterministic cold boots using the existing cold-boot timeout.

gc resolves only strictly named stim-cli-* AVDs through Android's selected root INI and its path/path.rel content location. The resolver follows the installed emulator's ANDROID_AVD_HOME, ANDROID_SDK_HOME/avd, then $HOME/.android/avd order, canonicalizes moved or symlinked content directories, and fails closed on malformed or unreadable entries. Measurable on-disk sizes appear for classified orphaned and stale owned Android rows. Each optional size probe is bounded and contained; unavailable sizes do not change cleanup decisions or block later rows.

Data-partition sizing remains intentionally unresolved: there is no representative owned AVD/app measurement supporting a safe default, so this change does not guess a size or add a setting. Part of #83; the issue remains open for that measured follow-up.

Test plan

  • Verify desktop and displayless-Linux emulator argv includes both snapshot flags while retaining headless flags.
  • Exercise the exact flags against installed Android emulator 36.4.9 with a deliberately nonexistent AVD; verify both flags are accepted and failure is only Unknown AVD name.
  • Cover AVD root precedence, absolute and relative moved paths, symlink canonicalization, invalid owned names, malformed selected-root fail-closed behavior, and all supported roots missing.
  • Verify gc sizes only classified orphaned/stale owned Android AVDs, bounds and contains each size probe, continues after failures/timeouts, omits unavailable sizes, and never includes a user-created AVD.
  • Run pnpm run format:check, pnpm run lint, pnpm run build, pnpm run typecheck, pnpm run knip, and pnpm test (2,263 passing).
  • Run pnpm run test:e2e (12 passing).

@janicduplessis
janicduplessis marked this pull request as ready for review August 29, 2026 04:35
@janicduplessis
janicduplessis merged commit c3a01e0 into main Aug 29, 2026
5 checks passed
@janicduplessis
janicduplessis deleted the codex/issue-83-android-storage branch August 29, 2026 04:35
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