Skip to content

[Roadmap] feat(studio): Android Studio plugin Phase 1 MVP — thin-client IDE integration - #153

Open
RanjithRagavan wants to merge 2 commits into
google:mainfrom
RanjithRagavan:upstream-android-studio-plugin
Open

RanjithRagavan wants to merge 2 commits into
google:mainfrom
RanjithRagavan:upstream-android-studio-plugin

Conversation

@RanjithRagavan

@RanjithRagavan RanjithRagavan commented Sep 25, 2026 •

Copy link
Copy Markdown

Summary

Implements Phase 1 of the Android Studio Integration roadmap item — a native IDE plugin (thin client) that brings ARTEMIS task dispatch and monitoring into Android Studio.

Part of #152 (Phases 2–3 — run configurations, breakpoint-aware runs, record mode — intentionally left as follow-ups).

@somew1nd @yaoyao-open-source would love your review when you have a moment — happy to adjust scope, directory placement, or packaging to fit the project's conventions.

What the plugin does

  • Tool window (right anchor): server reachability indicator, device dropdown from GET /api/devices, natural-language prompt dispatch via POST /api/run (flash/pro), live task list with 2 s polling via GET /api/sessions/{id}, detail pane, and Stop via POST /api/stop
  • Settings → Tools → ARTEMIS: server base URL, default profile, default device serial
  • Balloon notifications on task completion/failure

Architecture

Strict thin client: the plugin only speaks the same HTTP API as packages/artemis-client (endpoint shapes mirrored field-for-field, including legacy fallbacks like session_id/task_id/trace_id). No agent logic, no credentials surface in the IDE. java.net.http.HttpClient + platform-bundled Gson — zero external dependencies, keeping the plugin small (~1.7 MB zip) and free of dependency conflicts.

┌──────────────────────┐   HTTP    ┌──────────────────┐   ADB   ┌────────┐
│ Android Studio        │ ───────► │ ARTEMIS server   │ ──────► │ Device │
│ ARTEMIS tool window   │ ◄─────── │ (agents/models)  │ ◄────── │        │
└──────────────────────┘           └──────────────────┘         └────────┘

Compatibility

  • since-build="231", no until-build cap → Android Studio Hedgehog 2023.1.1 through current (Iguana/Jellyfish/Koala/Ladybug/Meerkat/Narwhal), and IntelliJ IDEA 2023.1+
  • Compiled/verified against IC 2024.3, JBR 17, IntelliJ Platform Gradle Plugin 2.2.1, Kotlin 2.0.21

Testing

  • 25/25 tests pass (./gradlew test): model JSON parsing (canned payloads mirrored from packages/artemis-client/tests), /api/run request building, and full submit → poll → stop integration against an in-process mock HTTP server, plus error paths (server down, HTTP 500, task rejection, 404 fallbacks)
  • ./gradlew buildPlugin → artemis-android-studio-plugin-0.1.0.zip ✅
  • ./gradlew verifyPluginStructure ✅
  • Not covered here (needs GUI/device): manual install into Android Studio and a live run against a real server — steps documented in android-studio-plugin/README.md; ./gradlew runIde works for a sandbox smoke test
  • Repo CI note: current workflows are Python/frontend-only; a Gradle CI job for android-studio-plugin would be a natural follow-up

Layout

android-studio-plugin/
├── build.gradle.kts / settings.gradle.kts / gradle.properties / gradlew
├── README.md                       (compatibility matrix, install, architecture)
└── src/
    ├── main/kotlin/com/google/artemis/studio/
    │   ├── api/        ArtemisApiClient (java.net.http + Gson), typed exceptions
    │   ├── model/      Device, TaskHandle, TaskResult, Capabilities, RunRequest
    │   ├── settings/   PersistentStateComponent + Configurable
    │   ├── services/   TaskPollingService (coroutines, EDT-safe), notifications
    │   └── toolwindow/ ToolWindowFactory + panel
    ├── main/resources/META-INF/plugin.xml
    └── test/kotlin/... (25 tests)

All sources carry the repo-standard Apache 2.0 header.

Test plan

  • ./gradlew test — 25/25 pass
  • ./gradlew buildPlugin + verifyPluginStructure — pass
  • Manual: install zip into Android Studio, point at a running artemis ui server, dispatch a task (documented in plugin README)

…egration

Implements Phase 1 of the Android Studio Integration roadmap item (google#152):
- Tool window: server status, device picker (GET /api/devices),
  natural-language task dispatch (POST /api/run), live status polling
  (GET /api/sessions/{id}), task stop (POST /api/stop)
- Settings page (Tools > ARTEMIS): server URL, default profile, device serial
- Thin client over the same HTTP API as packages/artemis-client; no agent
  logic in the IDE; java.net.http + Gson, zero external dependencies
- Kotlin models mirror the Python artemis-client payload shapes, including
  legacy field fallbacks
- 25 unit/integration tests (model parsing, request building, submit/poll/
  stop against a mock HTTP server, error paths)
- Compatibility: since-build 231 (Android Studio Hedgehog+ / IntelliJ
  2023.1+), no until-build cap; verified with buildPlugin +
  verifyPluginStructure
Pre-existing on main: 11 lint errors (datetime.UTC alias style) fail the
Lint Python step under the ruff version CI resolves today. Applied
ruff check --fix + format so the pipeline goes green again.
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