Repository navigation
Conversation
Adds a community plugin that runs Android projects from ZCode: a ui.surfaces side panel for devices, build, install, launch and logcat, backed by a local stdio MCP server and a zero-dependency CLI. - zero-config detection of Gradle project, adb, SDK, JDK, package, APK - project resolution scoped to the current window's workspace - streamed build/install output and live logcat in the panel - auto reinstall on signature mismatch (opt-out: --no-reinstall)
Collaborator
|
✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically. |
- flavor detection/selection; default to official debug, never build all channels - JDK selected by Gradle version + project config, switchable per project - status/job/logcat over MCP resources to avoid repeated approval prompts - no project file writes by default (local.properties optional)
Collaborator
|
✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically. |
- scrcpy 外部投屏:自动探测/安装提示、面板按钮、ar mirror、--stop - clean/rebuild:stale(transform/dex)/intermediates/gradle;增量缓存残留识别与提示 - 多渠道:多维度降级、auto-first、create()/注释解析、relaxed APK、flavorMissing - 状态/任务/日志走 MCP resource;默认不改工程文件
Collaborator
|
✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plugin type (required) / 插件类型(必填)
Affected plugin name(s) / 涉及的插件名称:
android-runnerThe plugin declares a
ui.surfacespanel (ui://android-runner/panel.html), so it is a UI Plugin.What / 改动内容
Adds
external_plugins/android-runner, a community plugin that runs Android projects from ZCode.Problem. Building, installing and launching an Android app means leaving the client, finding the right device, waiting for Gradle, then running
adbby hand. This plugin collapses that into one panel.Behavior
ui.surfaces): device cards (model/serial/Android version/physical or emulator, click to set the target), AVD list with one-click boot (waits up to 180s forsys.boot_completed), app info (package name, module/variant, APK size and build time), live environment report (SDK/adb/JDK/Gradle), action buttons (run, build, install, launch, stop, restart, logcat, environment check, uninstall, clear data), and a console that streams build/install output plus a live logcat tab.scripts/mcp-server.mjs) serves the panel resource and exposes one model-facing tool,open_panel, plus app-only tools used by the panel itself. Long operations run as background jobs with incremental output polling, so a 1–2 minute Gradle build does not block a tool call.scripts/ar.js, commands, skill) for the same operations from the terminal:doctor,devices,use,run,build,install,launch,stop,restart,logcat,uninstall,clear-data,info.gradlew, then scans downward inside the workspace), adb (local.properties→ANDROID_HOME→ common SDK paths →PATH), JDK (.idea/gradle.xmlgradleJvm→JAVA_HOME→ platform default), package name (output-metadata.json→applicationId), APK (newest underbuild/outputs/apk/<variant>/).Version.
0.6.0in bothplugin.jsonandmarketplace.json.Updates since the first revision
productFlavors(static parse + existing build outputs), defaults toofficialfor debug, never builds every channel at once. The panel offers a flavor dropdown plus free-text input; when no flavor can be detected it falls back to a plainassembleDebug.org.gradle.java.home,.idea/gradle.xml,JAVA_HOME, Android Studio JBR, installed JDKs), remembers a per-project choice, and can switch it from the panel.ui://android-runner/state.json,job/<id>.json,logcat.json) instead of tool calls, so panel refreshes do not trigger repeated approval prompts. Only user-clicked actions call MCP tools.local.propertiesis opt-in via--local-properties; builds pass the SDK throughANDROID_HOME).ADBpassed through). Panel button plusar mirror/ar mirror --stop.ar clean/ar rebuildwith--scope stale(transform/dex caches, default),intermediates, orgradle; prints removed dirs and freed space. Build failures matchingdefined multiple times/Duplicate class/DexArchiveMergerExceptionpoint to clean & rebuild.How it was tested
python3 scripts/validate.py→OK: 59 plugin(s) validated.build_dist.build_zip()succeeds (18 files, 78,738 bytes).:app:assembleOfficialDebugonly (10 flavors, no all-channel build), APK located underoutputs/apk/official/debug/.initialize,tools/list,resources/list,resources/readofui://android-runner/panel.html(mimetext/html;profile=mcp-app),tools/callfor status, a background job with incremental output, logcat start/poll/stop, and the destructive-action guard — 16/16 checks pass.BUILD SUCCESSFUL), install,am startlaunch,pidofconfirmation, logcat streaming.Note on
python3 scripts/build_dist.py: in my environment it stops at the pre-existingexcalidrawentry withincomplete build; run pnpm build first, which is unrelated to this plugin. Packagingandroid-runneralone through the same function works (see above).Dependencies, network, permissions, side effects
gradlewand the localadb; no network access of its own. Requires Node.js 18+ onPATHfor the MCP server.local.propertieswhen missing (writessdk.dir); remembers the chosen device in~/.android-runner/projects.jsonand the chosen project in~/.android-runner/panel-state.json(keyed by workspace).--no-reinstalldisables this and returns exit code 3 instead.uninstall/clear-datarequire confirmation in the panel and an explicit--yeson the CLI.Provenance
Original implementation ported from the author's own MIT-licensed
menggod/android-runner; the originalLICENSEis kept inside the plugin directory. No third-party assets beyond that.Self-check / 自查清单
external_plugins/<name>/; existing fixes retain ownershipcategoryis set independently of publisher ownership (developer-tools)versionbumped in BOTHplugin.jsonandmarketplace.json(artifacts are immutable) —0.4.0README.md(EN) andREADME_CN.md(中文) both updated and equivalentdescription_i18nhas bothenandzh-CNnodewith${ZCODE_PLUGIN_ROOT})python3 scripts/validate.pypasses locally;python3 scripts/build_dist.pyis blocked by a pre-existing unrelated plugin (see above)