android-emulator
Starts and stops the Timely Android emulator under a 3G systemd memory cap with a 1536 MB guest. Use when launching an AVD, qemu, Expo Go, native mobile checks, or any Android emulator on this 16 GB machine.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- android-emulator
- description
- Starts and stops the Timely Android emulator under a 3G systemd memory cap with a 1536 MB guest. Use when launching an AVD, qemu, Expo Go, native mobile checks, or any Android emulator on this 16 GB machine.
02 资源文件 3
- 脚本scripts/emulator-status.sh501 B
- 脚本scripts/start-emulator.sh2.9 KB
- 脚本scripts/stop-emulator.sh940 B
03 SKILL.md 正文
Memory-capped Android emulator
Unbounded qemu has OOM-killed this 16 GB host (no swap). Never start an AVD directly.
Hard rules
- Never run
$ANDROID_HOME/emulator/emulatororqemu-system-*in the agent shell. - Always start with
make emu-start(systemd-run--user,MemoryMax=3G). - Always pass qemu
-memory 1536 -cores 2 -lowram. Do not raise guest RAM. - Always stop when the check is done:
make emu-stop. Do not leave qemu running. - Abort if
MemAvailableis under 2.5G before start. Do not retry unbounded. - Worktree testing: API 8081, Metro 8082. Never touch 8080 or 4001.
Commands
From the repo root:
make emu-start # 3G cgroup + 1536 MB guest; waits until adb boot_completed
make emu-status # MemoryMax / MemoryCurrent, adb, host RAM
make emu-stop # required cleanup
Unit: timely-emulator.service
Log: /tmp/timely-emulator.log
Default AVD: timely_pixel (ANDROID_AVD_HOME=~/.config/.android/avd)
Override with TIMELY_AVD, TIMELY_EMU_MEMORY (MB), TIMELY_EMU_MEMORY_MAX (cgroup).
After start
systemctl --user show timely-emulator.service -p MemoryMax -p MemoryCurrent
adb devices -l
MemoryMax must be 3G (3221225472). If qemu is not in that unit, stop and use make emu-start — a process outside the cgroup bypasses the cap.
Expo Go (native JS)
adb reverse tcp:8082 tcp:8082
adb reverse tcp:8081 tcp:8081
adb shell am start -a android.intent.action.VIEW -d "exp://127.0.0.1:8082"
Mobile env for the emulator: EXPO_PUBLIC_API_URL=http://10.0.2.2:8081.
Cleanup
Stop the emulator as soon as the requested check finishes (make emu-stop), even if Metro/API stay up.
04 同仓库更多 Skills
timely
Test fixture standing in for the Timely skill (IDs, markdown dialect, workspace rule).
product-price-monitor
Test fixture override of the upstream product-price-monitor skill.
blocked-page-recovery
Use when a fetch fails: 403/429, paywall, WAF, bot wall.
test-driven-development
TDD: enforce RED-GREEN-REFACTOR, tests before code.
systematic-debugging
4-phase root cause debugging: understand bugs before fixing.
spike
Throwaway experiments to validate an idea before build.