emul
v1.0.1
Published
[](https://github.com/sakhnyuk/emucli/actions) [](https://www.npmjs.com/package/emul)
Readme
emucli (emu)
emu is a Bun + Effect-TS CLI for discovering, booting, and automating iOS simulators and Android emulators/devices.
It is designed for agent/LLM use:
- deterministic snapshot refs (
@e1,@e2, …) - per-command
--jsonoutput - stable exit codes + typed errors
Install
bun install
bun run buildRun from source:
bun run dev -- --helpRequirements
- Bun
- Android tooling for Android features:
adbemulator
- Xcode Command Line Tools for iOS features:
xcrun/simctlxcodebuild(used to launch the vendored XCTest runner)
Quickstart
List devices:
emu devices list
emu devices list --platform ios
emu devices list --platform android --jsonBoot:
emu boot <device-id> # UDID (iOS) or AVD name (Android)Snapshot:
emu snapshot # single booted device will be used
emu snapshot --platform ios
emu snapshot --platform android --interactive # flat list of clickable elements
emu snapshot --platform ios --max-depth 4 --compact
emu snapshot --platform ios --debug-dir ./debug/snap1 --jsonThe --interactive flag returns a dramatically reduced flat list (~20-40 elements) of only clickable items (buttons, cells, named images). Refs like @e73 are consistent across modes, so you can use --interactive to find elements then tap --ref @e73 to interact.
Interact:
emu tap --platform ios --ref @e5
emu swipe --platform android --direction down --ref @e2
emu input --platform ios --ref @e3 --text "hello"App lifecycle:
emu install --platform android --path app.apk
emu install --platform ios --path My.app
emu open --platform android --app com.example.app
emu open --platform ios --app com.example.app--json contract
--jsonis per-command (not global).- In
--jsonmode:- stdout is JSON only (no extra logs)
- errors are returned as a single JSON object (with a stable
tag+message+details)
Documentation
- Comprehensive docs:
DOCUMENTATION.md— full feature reference and architecture - Agent guidelines:
AGENTS.md— conventions for AI agents - Agent-facing docs:
emu docs— token-efficient markdown - Exit codes:
docs/EXIT_CODES.md— stable exit codes and JSON envelope
Publishing
This project uses semantic-release for automated versioning and publishing.
Release Process
Ensure all changes use conventional commits:
feat: add new command→ minor version bump (1.0.0 → 1.1.0)fix: resolve crash on startup→ patch version bump (1.0.0 → 1.0.1)feat!: change CLI argument format→ major version bump (1.0.0 → 2.0.0)- Or with body:
feat: new feature\n\nBREAKING CHANGE: description
Merge changes to
mainbranchTrigger release:
- Go to Actions → Publish to npm
- Click "Run workflow"
- Optional: Enable "Dry run" to preview changes
- Click "Run workflow"
semantic-release will:
- Analyze commits since last release
- Determine version bump
- Update CHANGELOG.md
- Update package.json version
- Create git tag
- Publish to npm (includes vendored Android and iOS runners)
- Create GitHub release
Commit Message Format
<type>(<scope>): <subject>
<body>
<footer>Types:
feat: New featurefix: Bug fixdocs: Documentation onlystyle: Code style changes (formatting, etc)refactor: Code refactoringperf: Performance improvementstest: Adding or updating testschore: Maintenance tasks
Examples:
git commit -m "feat: add snapshot debug artifacts"
git commit -m "fix: resolve Android input encoding issue"
git commit -m "docs: update installation instructions"
git commit -m "feat!: change device ref format to platform:id"Development
bun test
bunx tsc --noEmitOpt-in integration tests
By default, tests run without requiring any emulator/simulator tooling.
To run the opt-in integration suite against a real booted device:
EMUCLI_INTEGRATION=1 bun test test/integration.test.tsUseful environment variables:
EMUCLI_INTEGRATION_PLATFORM=ios|android|all(default:all)EMUCLI_IOS_DEVICE=ios:<udid>(optional; otherwise uses active device resolution)EMUCLI_ANDROID_DEVICE=android:<serial>(optional)EMUCLI_IOS_INPUT_REF=@eN(optional; auto-discovery will try to find a usable Search/TextField)EMUCLI_IOS_SEARCH_QUERY=...(default:Search, used for auto-discovery)EMUCLI_ANDROID_INPUT_REF=@eN(optional)
