HabitatEngine
Provides tools for automating Android devices, including reading the screen, interacting with UI elements via accessibility, launching apps, controlling system settings, running shell commands, and executing agent-driven tasks.
Habitat — Let AI Agents Drive Android
An embeddable Android automation runtime with an on-device MCP server and an autonomous agent (DeepSeek plans, TypeSafe Jev picks each tap, code verifies). Workflows are flat JSON that LLMs can write; execution goes through accessibility + system APIs.
What you get
Tell the phone what to do — "open Settings and go to Bluetooth", "turn brightness to max", "what's my battery?" The agent plans, uses device tools directly when it can, taps through the UI when it must, and verifies the result on screen. On-device eval: with planning, 28/28 for both Jev and DeepSeek executors (2026-10-09, 13–18/28 without) — method and raw data.
An MCP server on the phone — Claude Code and Cursor connect over Streamable HTTP (
http://127.0.0.1:8931/mcp), Claude Desktop through a bundled stdio bridge: read the screen, call all 88 nodes (each with a parameter schema), start agent tasks. Token-authenticated, dangerous tools off by default — setup.An embeddable engine — drop
:libinto your own app (JitPack) and run LLM-generated JSON workflows: triggers, branches, loops, variables, shell, HTTP, sensors, notifications.
Try it in 2 minutes
Install the APK from Releases on Android 10+ —
app-standard-arm64-v8a-release.apkfits almost every phone (universalif unsure).Open Habitat, enable its accessibility service when prompted.
Agent tab → pick an executor (Jev / DeepSeek / Local), paste your API key (stored encrypted on the device), type a goal, tap Start.
No key? Choose Local — it runs offline with simple heuristics.
Calling Jev from mainland China returns HTTP 451; see Jev network.
Prefer workflows? AI 生成 tab → describe a task in plain language → DeepSeek writes the JSON → save & run.
Use the engine in your app
// settings.gradle.kts
dependencyResolutionManagement { repositories { maven("https://jitpack.io") } }
// build.gradle.kts
implementation("com.github.Allenwang0730:HabitatEngine:v1.9.0")See docs/ENGINE_USAGE.md for initialization and permissions.
Related MCP server: Mobile Device MCP
Philosophy
Habitat workflows are flat JSON graphs. Every node has exactly two control-flow
mechanisms — next (linear) and branches (conditional) — and nothing else.
This is intentional:
LLMs are great at generating JSON — the flatter the structure, the fewer mistakes.
One variable syntax (
${varName}) — no{{}},[[]], or other delimiters to confuse.Validation is simple — check
start_node_idexists, checknextreferences are valid. Errors are descriptive enough to feed back to the LLM for auto-correction.
Quick Start
Minimal Workflow
{
"start_node_id": "hello",
"nodes": {
"hello": {
"id": "hello",
"type": "ACTION_TOAST",
"params": { "message": "Hello, Habitat!" }
}
}
}Execute from Code
val factory = NodeHandlerFactory(
a11y = AppAccessibilityProvider,
shell = ShizukuShellExecutor(context),
)
val graph = HabitatJson.fromJson(jsonString)
HabitatExecutionService.start(
workflowId, jsonString, context, factory,
onLog = { line -> println(line) },
onResult = { vars -> println(vars) }, // 工作流结束时的变量快照
)Why not Tasker / MaaFramework / Auto.js?
Tool | Style | Can you embed it in your app? |
Tasker / Automate / MacroDroid | End-user apps with GUI editors | ❌ |
MaaFramework | Embeddable & JSON task graphs, but C++ and image-recognition-first | ⚠️ |
Auto.js / AutoX.js | JavaScript scripting | ❌ |
Habitat | Embeddable Kotlin | ✅ |
Habitat is the one that is embeddable + LLM-generatable + dual-track. Define workflows as flat JSON designed for LLM output, embed the runtime in your app, and let agents or automation drive the device.
Node Types (88)
Full parameter reference: docs/NODES.md (generated from the node specs). The engine has 88 node types across categories. Common / core ones below (same list is in NodeKnowledge, the single source used for LLM generation — documented once here and in README_CN.md):
Type | Params | Purpose | Requires |
ACTION_SET_VARIABLE | name, value, type | set variable | |
ACTION_LOG | message | log | |
ACTION_DELAY | millis | delay | |
CONDITION_SWITCH | expression, branches | conditional branch | |
ACTION_TOAST | message | toast | |
ACTION_GET_TIME | format, output_var | get time | |
ACTION_MATH | operation, a, b, output_var | math | |
ACTION_TEXT_OPERATION | action, input, output_var | text op | |
ACTION_CLIPBOARD | action, text, output_var | clipboard | |
ACTION_PARSE_JSON | json, path, output_var | parse JSON | |
ACTION_HTTP_REQUEST | url, method, output_var, timeout | HTTP request | needs network |
ACTION_LAUNCH_APP | package_name | launch app | |
ACTION_CLICK | target, region, occurrence, offset_x, offset_y | click | needs a11y |
ACTION_INPUT_TEXT | text, mode | input text | needs a11y |
ACTION_READ_SCREEN | keyword, output_var | read screen | needs a11y |
ACTION_FIND_ELEMENT | selector, search_mode, region, timeout_ms, output_var | find element | needs a11y |
ACTION_GLOBAL_KEY | key | global key | needs a11y |
ACTION_SHELL | command, mode | shell | needs Shizuku/root |
ACTION_GET_BATTERY | output_var | battery | |
ACTION_NETWORK_STATUS | action | network | |
ACTION_GET_DEVICE_INFO | device info | ||
ACTION_SCREENSHOT | format, output_var | screenshot | screenshot perm |
ACTION_VIBRATE | duration | vibrate | |
ACTION_TEXT_TO_SPEECH | text, language | TTS | |
ACTION_FILE_OPERATION | action, path, content, output_var | file | |
ACTION_AI_CHAT | prompt, output_var | local AI chat | |
ACTION_CALL_DIRECT | phone_number, sim | direct call | CALL_PHONE |
ACTION_CALL_PHONE | phone_number | call | CALL_PHONE |
ACTION_SEND_NOTIFICATION | title, message, channel_id | notification | |
ACTION_SWIPE | x1,y1,x2,y2,duration_ms | swipe | needs a11y |
ACTION_MEDIA_CONTROL | cmd | media control |
Full categories in each NodeModules; NodeKnowledge is the single source for the AI-generation prompt and the node reference.
Interaction (6)
Type | What it does |
| Click coordinates or accessibility element ( |
| Linear swipe gesture |
| Long press |
| Type text (a11y / shell / clipboard) |
| System key (back, home, recents, …) |
| Find UI element by selector |
System (11)
Type | What it does |
| Execute shell command (Shizuku / root) |
| Launch app by package name |
| Force-stop app |
| Wake / sleep / unlock screen |
| WiFi on / off / toggle / status |
| Bluetooth on / off / toggle / status |
| Volume set / get / up / down / mute |
| Brightness set / get / auto |
| Flashlight on / off / toggle |
| Open dialer with number |
| System share sheet |
Telephony (2)
Type | What it does |
| Place call directly via |
| Block until the call ends (polls |
Data (8)
Type | What it does |
| Set workflow variable (string / int / float / bool) |
| Text replace / split / substring / case |
| Arithmetic (add / sub / mul / div / mod / pow) |
| Clipboard read / write |
| Parse JSON with dot-notation path |
| Parse XML with XPath |
| Base64 encode / decode |
| File read / write / delete / exists / list |
Logic (6)
Type | What it does |
| Branch on expression ( |
| Compare variable (== != > < >= <= contains …) |
| Wait (ms, max 60000) |
| Counted or expression-based loop ( |
| Exception wrapper ( |
| Emit log line (debug / info / warn / error) |
Sensors (5)
Type | What it does |
| Search screen content via accessibility |
| Read SMS inbox, extract verification codes |
| Foreground app package + activity |
| Foreground app (enhanced) |
| Search installed apps |
Network (2)
Type | What it does |
| HTTP GET / POST / PUT / DELETE with headers + body |
| Query network type, WiFi IP, mobile IP |
Media & UI (8)
Type | What it does |
| Screenshot (base64 or file) |
| TTS (zh / en / ja / ko) |
| Toast message |
| Haptic vibration |
| System notification |
| Floating heads-up notification |
| Floating mini screen: live text / image / progress from a workflow, the agent or an MCP script (draggable, collapsible; moves out of the way of agent taps) |
| Local workspace: write / append / read / list / delete results, notes and images (viewed in the app's Workspace tab, on-device only) |
AI (1)
Type | What it does |
| Local LLM inference (LiteRT-LM / Gemma 4 2B) |
Utility (2)
Type | What it does |
| Current time (custom format) |
| Random number (int / float / bool) |
Full parameter reference → HABITAT_API.md
Shared contract (client + server) → habitat-server/docs/API_CONTRACT.md in the server repo
Workflow Examples
SMS Verification Code Auto-Fill
{
"start_node_id": "read",
"nodes": {
"read": {
"type": "ACTION_READ_SMS",
"params": { "filter_by": "both", "sender": "code", "extract_code": true },
"next": "check"
},
"check": {
"type": "CONDITION_SWITCH",
"params": { "expression": "sms_found == true" },
"branches": { "true": "copy", "false": "fail" }
},
"copy": {
"type": "ACTION_CLIPBOARD",
"params": { "action": "set", "text": "${verification_code}" },
"next": "input"
},
"input": {
"type": "ACTION_INPUT_TEXT",
"params": { "text": "${verification_code}", "mode": "a11y" }
},
"fail": {
"type": "ACTION_TOAST",
"params": { "message": "No code found" }
}
}
}One-Tap System Setup
{
"start_node_id": "s1",
"nodes": {
"s1": { "type": "ACTION_WIFI", "params": { "action": "on" }, "next": "s2" },
"s2": { "type": "ACTION_BRIGHTNESS", "params": { "action": "set", "value": 80 }, "next": "s3" },
"s3": { "type": "ACTION_VOLUME", "params": { "action": "set", "stream": "music", "value": 40 }, "next": "done" },
"done": { "type": "ACTION_TOAST", "params": { "message": "Configured" } }
}
}More examples → HabitatSamples in HabitatJson.kt
DAG Visual Editor
The editor renders workflows as interactive directed acyclic graphs on a custom Canvas view.
Feature | Detail |
Layout | Sugiyama-style layered auto-layout |
Node colors | Color-coded by category (interaction / system / data / logic / network / sensor) |
Edge types | Gray solid ( |
Gestures | One-finger pan, two-finger pinch-zoom, double-tap reset, tap a node for details |
Toggle | Switch between raw JSON editor and DAG visualizer |
Node-level label and description fields control DAG display labels (optional, fully backward-compatible).
EditorTab (Compose)
├── OutlinedTextField: name, description, JSON
├── Toggle: "JSON" ↔ "DAG Flowchart"
├── AndroidView → DagView (Canvas)
│ ├── DagLayoutEngine (auto-layout)
│ └── HabitatDagConverter (WorkflowGraph → DagGraph)
└── Execution logs (LazyColumn)AI Workflow Generation (LLM-friendly, core selling point)
Natural language → workflow JSON, generated by DeepSeek (prompt built dynamically from NodeKnowledge, incl. an Android operation guide):
WorkflowAIGenerator.generate(context, "call 10086 and record") // → GeneratedWorkflow(workflowJson, ...)13 typical scenarios, 100% generation accuracy (incl. "dial directly via CALL_DIRECT instead of UI simulation", "repeated text uses region")
Prompt includes: full node list with parameters (from the node specs) + common package map + priority rule (direct API preferred) + permission prerequisites + few-shot examples
Per-generation cost ≈ 0.02–0.05 CNY (DeepSeek)
MCP Mobile Agent (AI controls the phone)
The engine exposes an MCP server (JSON-RPC 2.0):
adb forward tcp:8931 tcp:8931 # the server listens on the phone's 127.0.0.1 by default
http://127.0.0.1:8931/mcp # Streamable HTTP, Authorization: Bearer <token>
ws://127.0.0.1:8931/mcp?token=<token> # WebSocket (scripts/mcp_call.mjs)
claude mcp add --transport http habitat http://127.0.0.1:8931/mcp --header "Authorization: Bearer <token>"initialize / tools/list / tools/callstandard MCP. Cursor / Claude Desktop config: docs/MCP.md; every node tool carries a JSON Schema generated from the node specsAuth: a random token is generated per install (view / copy / regenerate on the App's Agent page); LAN access is off by default; dangerous nodes (shell, files, SMS, calls, …) are refused for remote callers unless explicitly enabled
supports
region/occurrenceto precisely target repeated text (e.g. "tap the confirm button at the bottom")WeChat reading: only in the
wechatbuild flavor (./gradlew :app:assembleWechatDebug), which adds a reader service namedSelectToSpeakService— WeChat only exposes its UI tree to that class name, so this impersonates a Google component: personal use only, not for store distribution. The defaultstandardflavor doesn't include it and falls back to on-device ML Kit OCRPC side
scripts/agent_daemon.mjs(persistent connection) /mcp_call.mjs(one-off calls,--fullfor untruncated fields)
Autonomous mode: planner (DeepSeek) + executor (Jev) + code control
goal ─► DeepSeek plans: a few steps, each with a completion condition visible on screen; uses device tools when possible
▼
each step: tool step calls the device directly / UI step lets the executor (Jev / DeepSeek / local) pick one candidate per screen
│ stuck (looping / no change / low confidence) → replan the rest from the current screen (≤2 times)
▼
DeepSeek review: checks on-screen evidence that the goal is really done; answers question-style goalsModels choose, code controls: the executor only picks from code-built candidates; step progress, navigation stack + page graph, loop detection, recovery and safety gates live in code
Device tools: jump straight to 15 settings pages, toggle Wi-Fi / Bluetooth / flashlight / DND, set brightness / volume, read battery / time / device info / network. State-changing tools must be named in the user's own goal
Page state: package + activity + title identify the page; switch on/off, slider %, and input contents go into the candidates; the nav stack tells the model where it is, where Back goes, and which entries were already tried
Safety: planner output is untrusted — tool/arg allow-lists, typed text must be a substring of the goal, payment buttons / permission dialogs are unlocked only by the user's original goal
Entry points: the Agent page (executor Jev / DeepSeek / local, "DeepSeek planning & review" switch); MCP
agent_start(goal/provider/max_steps/planner),agent_stop,agent_statusJev from mainland China returns HTTP 451: use a proxy/VPN on the phone, or set "Jev proxy" to
127.0.0.1:<PC proxy port>and runadb reverse tcp:<port> tcp:<port>
On-device evaluation (one vivo phone, Android 16; results verified independently via adb / screen reads, not the agent's own DONE). Method, raw data and limitations: docs/EVAL.md.
Executor | with planner | without | date / commit |
Jev | 28/28 | 13/28 | 2026-10-09 · |
DeepSeek | 28/28 | 18/28 | 2026-10-09 · |
DeepSeek | 10/10 | 7/10 | 2026-10-14 · |
Tasks: open Bluetooth page, search inside Settings, open About phone, switch Clock to stopwatch, max brightness, ask battery level, ask Android version; since 2026-10-14 also search without quotes, type a QQ message, call a carrier by name. Reproduce with node scripts/agent_eval.mjs (tasks in scripts/agent_eval_tasks.json). See docs/AGENT.md.
Testing
Unit tests (JVM, no device):
./gradlew :lib:testDebugUnitTest :app:testDebugUnitTest(126 tests)Engine self-test:
scripts/run_selftest.ps1(68 regressions = 53 PASS / 0 FAIL / 15 SKIP, needs a device)Autonomous-mode device eval:
node scripts/agent_eval.mjs(scripts/agent_eval_show.mjsfor details)LLM generation accuracy:
scripts/verify_workflow_gen.ps1(13 scenarios)
Local AI (LiteRT-LM)
Habitat bundles Google LiteRT-LM for on-device LLM inference — no network required.
Model:
.litertlmformat, recommended Gemma 4 2B (~2.4 GB)Path:
/storage/emulated/0/Download/llm/Permission: "All files access" needed to read the model file
Use the LLM Console (Profile tab → LLM Console) to load models and test prompts.
In workflows, ACTION_AI_CHAT calls the loaded model:
{
"type": "ACTION_AI_CHAT",
"params": {
"prompt": "Summarize: ${screen_content}",
"output_var": "summary"
},
"next": "next_step"
}Project Structure
Habitat/ # Root project
├── lib/ # :lib — engine (zero Android UI deps)
│ └── com/ailun/habitat/
│ ├── api/ # IAccessibilityProvider, IShellExecutor
│ ├── handlers/ # ~80 INodeHandler implementations
│ ├── HabitatExecutor.kt # Coroutine-based execution loop
│ ├── HabitatJson.kt # JSON parser + sample workflows
│ ├── WorkflowGraph.kt # Graph model (start_node_id + nodes)
│ ├── WorkflowNode.kt # Node model (id, type, params, next, branches)
│ ├── WorkflowContext.kt # Per-run state, ${var} interpolation
│ ├── NodeHandlerFactory.kt # Type-string → handler registry
│ └── INodeHandler.kt # Single-method handler interface
│
├── app/ # :app — Compose UI, bridges, services
│ └── com/ailun/habitat/app/
│ ├── ui/ # ProfileTab, HabitatSettingsActivity
│ ├── bridge/ # AppAccessibilityProvider, ShizukuShellExecutor
│ ├── ai/ # NodeKnowledge(node docs), WorkflowAIGenerator(LLM gen), WorkflowAIClient(DeepSeek), LLMServiceProvider, LiteRtLLMServiceImpl
│ ├── agent/ # autonomous mode: Planner, AgentLoop, ActionCatalog, DeviceTools, NavigationState, ScreenObserver
│ ├── dag/ # DagView, DagLayoutEngine, DagModel
│ ├── triggers/ # Notification, SMS, Timer, Clipboard, Key
│ ├── HabitatDashboard.kt # Main scaffold + editor in home card + Agent control entry
│ ├── FloatWindowUI.kt # Floating overlay ball + panel
│ ├── HabitatFloatService.kt
│ └── HabitatTheme.kt # Material 3 teal color scheme
│
├── TODO.md # Task tracking (client-side)
└── README.md # This fileDependency Decoupling
The engine (:lib) has zero compile-time dependency on the app module (:app).
All OS access goes through two interfaces:
INodeHandler
↑
├── IAccessibilityProvider (getService, foregroundPackage, foregroundActivity)
└── IShellExecutor (exec: suspend (cmd, asRoot) → String)
↑
bridge/ (app module implementations)
├── AppAccessibilityProvider ← weak ref to accessibility service
└── ShizukuShellExecutor ← delegates to HabitatShellManagerTo use the engine in a different app, implement these two interfaces.
Cloud Backend (Habitat Server)
A Spring Boot 3.5 server provides AI-powered workflow generation and web service publishing.
See habitat-server/README.md in the server repository for details.
Feature | Endpoint |
AI workflow generation |
|
Workflow CRUD |
|
API key management |
|
Publish as web service |
|
Permissions
Feature | Permission |
Click / swipe / read screen / input | Accessibility Service |
Read SMS |
|
Notifications |
|
Vibrate |
|
Shell (system-level) | Shizuku or Root |
Screenshot | Accessibility Service |
Flashlight |
|
Open dialer | None ( |
Direct call ( |
|
Wait call end ( |
|
Extending
class MyHandler : INodeHandler {
override suspend fun handle(node: WorkflowNode, ctx: WorkflowContext): String? {
val param = ctx.interpolate(node.params?.get("key")?.toString() ?: "")
ctx.variables["result"] = "done"
return node.next
}
}
// Register
factory.register("MY_ACTION", MyHandler())⚠️ Handler thread constraint: handlers run on
Dispatchers.Default(background coroutine thread, no Looper). Use synchronous queries (e.g.TelephonyManager.callState) or bring your ownExecutor/HandlerThread; do not use APIs that depend onLooper.myLooper()(e.g.PhoneStateListener) — will crash because Looper is null. See docs/ENGINE_EXTENDING.md.
FAQ
Problem | Solution |
Workflow won't start | Check |
Variables resolve to | Check the variable was set via |
Infinite loop | Check loop condition; hard cap is 1000 steps |
Accessibility actions fail | Confirm accessibility service is running |
Shell commands return empty | Check Shizuku / root is connected |
WiFi / Bluetooth operations fail | Android 10+ restrictions may apply |
Habitat · 88 node types · LLM-friendly · MCP agent · embeddable · accessibility + system API · habitat-server companion backend
Available Tools
78 toolsACTION_AI_CHATA
调用端侧本地大模型对话,回复存入变量(需宿主注入 LLM 服务且本地模型已加载)。输出:llm_success, llm_result, llm_error。模型未加载时 llm_success=false 并写 llm_error;推理抛错时错误文本也会写进 output_var,判断成败看 llm_success。Habitat 自带实现推理失败会返回以 "Error:" 开头的文本且 llm_success 仍为 true。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: prompt (required), require, on_error, output_var, +1 more.
ACTION_APP_SEARCHA
搜索已安装应用,结果为 JSON 数组。输出:app_list, app_count, app_search_success, app_search_error。每项含 package、name、is_system、version_name、version_code。Android 11+ 受包可见性限制,没有桌面图标的应用可能搜不到。节点必须带 params(可为 {}),缺 params 字段时什么都不做。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: query, require, sort_by, on_error, +4 more.
ACTION_ARRAYA
数组变量操作:建立、追加、弹出、取值、长度、拼接、清空、删除、包含。输出:array_result。value、item、index 不做 ${var} 插值;元素一律按字符串存。数组本体存回 var。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: var (required), action (required), item, index, +6 more.
ACTION_ASSERTA
断言:条件为假时让本节点失败,进入错误处理。失败按节点出错处理,可被 on_error、ACTION_TRY_CATCH、ACTION_RETRY 捕获。运算符 ==、!=、>、<、>=、<=(无 contains);两边先按变量名取值,取不到当字面值;不支持 ${var},值不加引号。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: condition (required), message, require, on_error, +1 more.
ACTION_BASE64A
Base64 编码或解码(UTF-8 文本)。输出:base64_result, base64_success。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: data (required), action (required), require, on_error, +2 more.
ACTION_BLUETOOTHA
蓝牙开关、切换、查询状态(开关需 Shizuku 或 root(Android 13+ 系统 API 对普通应用无效);status 不需要)。输出:bluetooth_success, bluetooth_enabled。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: action (required), require, on_error, node_timeout_ms.
ACTION_BRIGHTNESSA
屏幕亮度:设置、读取、开关自动亮度(set/auto_on/auto_off 需「修改系统设置」权限(WRITE_SETTINGS);get 不需要)。输出:brightness_success, brightness_error, brightness_value, brightness_mode。自动亮度开着时 set 的值可能被系统改掉,要固定亮度先 auto_off。brightness_mode 为 auto/manual。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: action (required), value, require, on_error, +1 more.
ACTION_CLICKA
点击:按坐标、界面文字或 resource-id 点击目标(需无障碍)。输出:click_success。同一文字可能多处出现(多个「确定」「发送」):用 region 限定区域或 occurrence 取第 N 个,避免点错。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: target (required), region, require, offset_x, +4 more.
ACTION_CLIPBOARDA
读取或写入系统剪贴板。输出:clipboard_content, clipboard_success, clipboard_error。Android 10+ 应用在后台时系统禁止读剪贴板,get 可能得到空串而 clipboard_success 仍为 true。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: action (required), text, require, on_error, +2 more.
ACTION_DELAYA
暂停指定毫秒数。超过 60 秒的等待用 ACTION_WAIT_UNTIL_TIME。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: millis, require, on_error, node_timeout_ms.
ACTION_DND_MODEA
免打扰:查询或切换模式(on/off/priority/alarms 需免打扰权限(ACCESS_NOTIFICATION_POLICY,授了通知使用权也算);get 不需要)。输出:dnd_success, dnd_error, dnd_state。dnd_state 取值 off/on/priority/alarms/unknown(off=未开免打扰)。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: action, require, on_error, node_timeout_ms.
ACTION_DYNAMIC_ISLANDA
屏幕顶部弹出灵动岛样式的胶囊提示,到时自动消失(宿主 App 注册;需悬浮窗权限)。duration_ms 必须是数字,写成字符串会被忽略按 3000。不阻塞,显示后立即执行下一节点;没有悬浮窗权限时静默失败,不写任何变量。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: message (required), require, on_error, duration_ms, +1 more.
ACTION_FIND_ELEMENTA
找元素:限时轮询查找界面元素,输出是否找到、边界和文字(需无障碍)。输出:element_found, element_error, element_bounds, element_text, element_clickable。element_bounds 是 "left,top,right,bottom" 四个数,不能直接当 ACTION_CLICK 的 target(会点到左上角)。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: selector (required), region, require, on_error, +4 more.
ACTION_FLASHLIGHTA
手电筒开关。输出:flashlight_success, flashlight_on。系统没有同步查询手电状态的 API:toggle 按本次运行记录的 flashlight_on 取反,没记录时一律打开。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: action (required), require, on_error, node_timeout_ms.
ACTION_FOREGROUND_APPA
获取前台应用包名/Activity(先无障碍,拿不到再走 shell dumpsys)(需无障碍或 Shizuku/root)。输出:foreground_package, foreground_success, foreground_activity, foreground_class。拿不到时写 unknown 且 foreground_success=false;foreground_class 为短类名。节点必须带 params(可为 {}),缺 params 字段时什么都不做。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: require, on_error, use_shell, output_var, +2 more.
ACTION_GEOCODEA
地址与经纬度互查(OpenStreetMap Nominatim,免 key)(需网络)。输出:geocode_success, geocode_error, latitude, longitude, address。地址查询取第一个结果写 latitude/longitude,逆查写 address,会覆盖同名变量(如 ACTION_GET_LOCATION 写的 latitude/longitude)。境外第三方服务,可能慢或不可达;连接/读取超时固定各 10 秒。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: address, require, latitude, on_error, +2 more.
ACTION_GET_APP_INFOA
读取前台应用包名和 Activity(经无障碍)(需无障碍)。输出:current_app, current_activity。无障碍未开时写 unknown;需要 shell 兜底请用 ACTION_FOREGROUND_APP。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: require, on_error, output_var, activity_var, +1 more.
ACTION_GET_AUDIO_STATEB
读取是否在播放音乐、是否连着耳机。输出:music_active, headset_connected, audio_state_success, audio_state_error。headset_connected 含有线/USB 耳机和蓝牙 A2DP。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: require, on_error, node_timeout_ms.
ACTION_GET_BATTERYA
读取电量和充电状态。输出:battery_level, battery_charging, battery_success, battery_error。battery_level 为 0–100;充满时 battery_charging 也为 true。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: require, on_error, output_var, node_timeout_ms.
ACTION_GET_CALL_STATEA
读取当前电话状态(需 READ_PHONE_STATE 权限)。输出:call_state, call_state_name, call_success, call_error。call_state:0=空闲 1=响铃 2=通话中;call_state_name:idle/ringing/offhook。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: require, on_error, node_timeout_ms.
ACTION_GET_DEVICE_INFOB
读取设备型号、Android 版本和屏幕尺寸。输出:device_model, device_manufacturer, device_brand, device_android_version, device_sdk, device_screen_width, device_screen_height, device_density, device_success, device_error。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: require, on_error, node_timeout_ms.
ACTION_GET_LOCATIONA
读取系统最后一次已知位置(GPS/网络取较新者)(需定位权限)。输出:location_success, location_error, latitude, longitude, location_accuracy, location_time, location_summary。不主动定位:从没定位过会失败,结果可能是旧位置(看 location_time 毫秒时间戳)。location_accuracy 单位米。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: require, on_error, output_var, node_timeout_ms.
ACTION_GET_SCREEN_STATEB
读取屏幕是否亮着、是否锁屏。输出:screen_on, screen_locked, screen_state_success, screen_state_error。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: require, on_error, node_timeout_ms.
ACTION_GET_SENSORA
读取一次光线、距离或加速度传感器的值。输出:sensor_value, sensor_type, sensor_success, sensor_error。只取首个读数的第一个分量(加速度为 X 轴);3 秒内没有读数即失败。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: type, require, on_error, output_var, +1 more.
ACTION_GET_SETTINGA
读取一项系统设置(只读)。输出:setting_value, setting_key, setting_namespace, setting_success, setting_error。值总是字符串;键不存在或无权读取时 setting_success=false(新版 Android 限制读取部分 secure/global 键)。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: key (required), require, on_error, namespace, +2 more.
ACTION_GET_SIM_INFOA
读取 SIM 卡数量、运营商、号码(需 READ_PHONE_STATE 权限)。输出:sim_count, sim_carriers, sim_numbers, sim_summary, sim_success, sim_error。sim_carriers / sim_numbers 为逗号分隔;很多 SIM 卡不存本机号码,sim_numbers 常为空。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: require, on_error, output_var, node_timeout_ms.
ACTION_GET_STORAGE_INFOB
读取内部存储空间(字节)。输出:storage_total, storage_available, storage_used, storage_available_percent, storage_success, storage_error。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: require, on_error, node_timeout_ms.
ACTION_GET_TIMEA
获取当前时间及年月日时分秒。输出:current_time, current_timestamp, current_year, current_month, current_day, current_hour, current_minute, current_second, current_weekday, time_success。current_weekday 0=周日…6=周六(与 ACTION_PARSE_DATETIME 的 1=周一不同)。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: format, require, on_error, timestamp, +2 more.
ACTION_GET_TRAFFICB
读取开机以来整机累计收发流量(字节)。输出:traffic_rx, traffic_tx, traffic_total, traffic_summary, traffic_success, traffic_error。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: require, on_error, output_var, node_timeout_ms.
ACTION_GET_WEATHERA
按经纬度查当前天气(Open-Meteo,免 key)(需网络)。输出:weather_success, weather_error, weather_temperature, weather_wind_speed, weather_wind_direction, weather_code, weather_json。温度 ℃、风速 km/h;连接/读取超时固定各 10 秒。weather_code 为 WMO 代码:0 晴,1–3 多云/阴,45/48 雾,51–67 毛毛雨/雨,71–77 雪,80–82 阵雨,85/86 阵雪,95–99 雷暴。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: latitude (required), longitude (required), require, on_error, +2 more.
ACTION_GLOBAL_KEYA
全局按键:返回、桌面、最近任务、通知栏、回车等(需 Shizuku/root 或无障碍(见 key 说明))。输出:key_success。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: key (required), require, on_error, node_timeout_ms.
ACTION_GLOBAL_NAVA
无障碍全局动作:返回、桌面、最近任务、通知栏、快捷设置、电源菜单、锁屏、截屏(需无障碍)。输出:nav_success, nav_error。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: action (required), require, on_error, node_timeout_ms.
ACTION_HTTP_REQUESTA
发送 HTTP 请求,响应体存入变量(需网络)。输出:http_success, http_error, http_status_code, http_response, http_truncated。headers / body 要写成字符串(JSON 转义成字符串);写成嵌套 JSON 对象会被转成 {k=v} 文本而失效。请求失败不抛错:看 http_success(状态码 200–399 为 true),要按节点出错处理可加 require=http_success。对不稳定的第三方服务设合理 timeout(失败默认跳过继续)。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: url (required), body, method, headers, +6 more.
ACTION_INPUT_TEXTA
输入文字:写入输入框,可选输入后回车提交(需无障碍(mode=shell/ime 需 Shizuku 或 root))。输出:input_success。a11y 模式会读回输入框核对内容。shell/ime 的 input text 打不出中文等非 ASCII 字符。QQ/微信等输入框点过后常不报告焦点,传 target 坐标才写得进去。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: mode, text, submit, target, +4 more.
ACTION_LAUNCH_APPA
打开应用,或打开系统设置的某一页。输出:launch_success, launch_error, launch_has_overlay, launch_package。Android 10+ 后台启动可能被系统静默拦截而 launch_success 仍为 true;launch_has_overlay 表示是否有悬浮窗权限(后台启动的豁免条件之一)。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: require, activity, on_error, package_name, +2 more.
ACTION_LOGA
输出一条调试日志。只写 Logcat(tag HabitatLog),不进工作流运行日志;要让用户看到请用 ACTION_TOAST 或 ACTION_WORKSPACE。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: level, message, require, on_error, +1 more.
ACTION_LONG_PRESSA
长按:按坐标或界面文字 / viewId 长按目标(需无障碍)。输出:long_press_success。target 含逗号一律按坐标解析,解析失败直接失败(不像 ACTION_CLICK 会退回文字匹配);不支持 region/occurrence。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: target (required), require, duration, on_error, +1 more.
ACTION_LOOPA
计数或条件循环:每次进入判断是跳进循环体还是走 next 结束。输出:loop_index。循环体最后一个节点的 next 要指回本循环节点;本节点的 next 是循环结束后的去向。count 模式结束时 counter_var 重置为 0。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: body_node (required), mode, times, require, +5 more.
ACTION_MATHA
两个数的四则、取模、乘方运算。输出:math_result。结果总是小数(如 5.0),CONDITION_SWITCH 用 == 比较时要写 5.0,或改用 > / <;除数为 0 时结果为 0;无法解析的操作数按 0。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: operation (required), a, b, require, +3 more.
ACTION_MEDIA_CONTROLA
媒体控制:向当前播放的应用发送播放/暂停/切歌等媒体键(需 Shizuku 或 root)。输出:media_success, media_error。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: cmd, require, on_error, node_timeout_ms.
ACTION_MINI_SCREENA
悬浮小屏:给用户实时显示文字、图片、进度(宿主 App 注册;需开启 Habitat 无障碍服务或悬浮窗权限)。输出:mini_screen_success, mini_screen_shown, mini_screen_error。show/append 时 text、image、title、progress 至少给一个。不阻塞。用户在本次运行中关掉小屏后,后续写入只更新内容不再弹出(mini_screen_shown=false)。来源标签由系统标注,不能用参数指定。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: text, image, title, action, +6 more.
ACTION_NETWORK_STATUSA
查询是否联网、网络类型,可选查 IP。输出:network_connected, network_type, wifi_ip, mobile_ip, network_success, network_error。network_type:wifi / cellular / ethernet / other / none。mobile_ip 实为第一个非回环 IPv4 地址,连着 WiFi 时可能就是 WiFi 地址。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: action, require, on_error, node_timeout_ms.
ACTION_PARSE_DATETIMEA
取当前时间、解析或格式化日期时间,可加减偏移。输出:datetime_result, datetime_epoch, datetime_year, datetime_month, datetime_day, datetime_hour, datetime_minute, datetime_second, datetime_weekday, datetime_success, datetime_error。按 LocalDateTime 解析,input_format 必须含时间部分(纯日期如 yyyy-MM-dd 会失败);datetime_weekday 1=周一…7=周日。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: input, action, format, require, +8 more.
ACTION_PARSE_JSONA
解析 JSON 字符串并按路径取值。输出:parsed_json, parsed_value, parse_success, parse_error。结果都是字符串(对象/数组为格式化 JSON);路径不存在时结果是字符串 null,但 parse_success 仍为 true。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: json (required), path, require, on_error, +2 more.
ACTION_PARSE_XMLA
解析 XML 字符串,按标签路径取元素文本或属性。输出:xml_parsed_value, xml_success, xml_error。匹配到多个元素时结果是 JSON 数组字符串。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: xml (required), xpath, require, on_error, +3 more.
ACTION_PLAY_MEDIAA
播放本地媒体文件(只出声),播完或超时才继续。输出:play_success, play_error, play_completed, play_duration_ms。到超时就停止播放。play_success 只表示开始播放成功,是否自然播完看 play_completed;loop=true 时永远播不完,到 timeout_ms 停止且 play_completed=false。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: path (required), loop, require, on_error, +3 more.
ACTION_RANDOMB
生成随机整数、小数或布尔值。输出:random_value, random_success。int 含两端,float 为 [min, max);min > max 时自动交换。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: max, min, type, require, +3 more.
ACTION_READ_NOTIFICATIONSA
读取通知栏当前通知列表(JSON 数组)(需通知使用权)。输出:notifications_success, notification_success, notifications_json, notification_count, notification_error。每项含 package、title、text、post_time。notification_success 是 notifications_success 的旧名,值相同。宿主未注入通知监听源时只能读到本应用自己的通知,并按失败处理。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: limit, package, require, on_error, +2 more.
ACTION_READ_SCREENA
在当前界面找关键字,或抓取全屏可见文字(需无障碍)。输出:screen_data。screen_data 是「是否找到 keyword」的布尔值,不是屏幕文字;要文字请设 output_var。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: keyword, require, on_error, output_var, +1 more.
ACTION_RETRYA
失败重试:反复执行目标节点(链),直到成功或次数用完。目标链最后一个节点的 next 要指回本节点;链上有节点失败就重试,成功或用完次数后走本节点 next。多数节点出错只是 xxx_success=false,要给它加 require(如 require=file_success)才算失败。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: target (required), times, require, on_error, +2 more.
ACTION_SCREENSHOTA
截取当前屏幕(shell screencap),输出 base64 JPEG 或文件路径(需 Shizuku 或 root(screencap))。输出:screenshot_success, screenshot_error, screenshot_width, screenshot_height, screenshot_base64。截图文件写在 DCIM/habitat_screenshot_<时间戳>.png,不会自动删除。节点必须带 params(可为 {}),缺 params 字段时什么都不做。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: format, quality, require, on_error, +2 more.
ACTION_SCREEN_WAKEA
亮屏、息屏、亮屏并解锁(sleep 和解锁需 Shizuku 或 root;wake 无 shell 时退回 WakeLock)。输出:screen_wake_success。wake_and_unlock 不核对是否真的解锁(按键序列发完即算成功);图案锁解不了。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: action (required), require, on_error, password, +1 more.
ACTION_SEND_NOTIFICATIONA
发一条系统通知(宿主 App 注册;Android 13+ 需通知权限(POST_NOTIFICATIONS))。title / message 原样显示,不做 ${var} 插值。不写任何输出变量。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: title, message, require, on_error, +1 more.
ACTION_SET_ALARMA
设闹钟:打开系统时钟的新建闹钟(带时间和标签)。输出:alarm_success, alarm_error。通过 Intent 调起系统时钟应用(不是静默创建),后台启动受限时可能没弹出来。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: hour (required), minute (required), label, require, +2 more.
ACTION_SET_VARIABLEB
设置一个变量。含 ${var} 的值插值后是字符串;后续要做数字运算/比较时设 type=int 或 float。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: name (required), type, value, require, +2 more.
ACTION_SHAREA
分享文字:弹出系统分享面板。输出:share_success, share_error。只通过 EXTRA_TEXT 分享文字,不附带文件;改 type 也发不了图片。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: text (required), type, title, require, +3 more.
ACTION_SWIPEA
滑动:从 (x1,y1) 直线滑到 (x2,y2)(需无障碍)。输出:swipe_success。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: x1 (required), x2 (required), y1 (required), y2 (required), +4 more.
ACTION_TEXT_OPERATIONA
文本处理:替换、截取、拆分、大小写、去空白、拼接。输出:text_output。split 的结果是用换行连接的一个字符串,不是数组;要真正的数组用 ACTION_ARRAY(action=set)。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: action (required), end, new, old, +8 more.
ACTION_TEXT_TO_SPEECHA
用系统 TTS 朗读文本,读完才继续(需系统已装 TTS 引擎)。输出:tts_success, tts_error。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: text (required), pitch, speed, require, +4 more.
ACTION_TOASTA
弹出一条短提示。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: message, require, on_error, node_timeout_ms.
ACTION_TRY_CATCHA
按上一个节点是否失败走 success / error 分支。输出:exception_msg。只看紧挨着的上一个节点:失败指抛异常、超时或 require 不满足;多数节点出错只是 xxx_success=false,要在上一节点加 require(如 file_success)才算失败。分支写在 branches(success/error → 节点 id),不走 next,success 分支也要写,缺的分支即该路径结束。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: require, on_error, catch_var, node_timeout_ms.
ACTION_VIBRATEB
振动一次。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: require, duration, on_error, amplitude, +1 more.
ACTION_VOLUMEA
音量:设置、读取、增减、静音。输出:volume_success, volume_current, volume_max。value 是百分比,而 volume_current/volume_max 是系统档位(如 0-15),两者不能直接比较。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: action (required), value, stream, require, +2 more.
ACTION_WAIT_CALL_ANSWERA
阻塞等待通话进入通话中(OFFHOOK)(需 READ_PHONE_STATE 权限)。输出:call_answered, call_error。5 秒内既没响铃也没进入通话就返回 false,不会等满超时。去电一拨出系统即为 OFFHOOK,不代表对方已接听;来电则表示已接起。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: require, on_error, timeout_ms, node_timeout_ms.
ACTION_WAIT_CALL_ENDA
阻塞等待当前通话挂断(每秒轮询通话状态)(需 READ_PHONE_STATE 权限)。输出:call_ended, call_error。进入时没有通话且 3 秒内也没出现通话,直接返回 call_ended=true(视为已结束)。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: require, on_error, timeout_ms, node_timeout_ms.
ACTION_WAIT_FOR_ELEMENTA
等元素:每 500ms 轮询,等待界面元素出现或消失(需无障碍)。输出:element_found。结果为 true 表示条件满足:wait_for=disappear 时 true 是「已消失」。只查当前活动窗口。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: selector (required), mode, require, on_error, +4 more.
ACTION_WAIT_UNTIL_TIMEA
等待到指定时刻再继续(每秒轮询)。输出:time_reached, wait_until_time。执行器默认单节点超时 30 分钟:等待超过 29 分钟需同时设 node_timeout_ms=0(或足够大),否则 timeout_ms 会被截到 29 分钟。clock 模式下今天已过的时刻顺延到明天;超时后 time_reached=false 并继续 next。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: time (required), mode, require, on_error, +3 more.
ACTION_WIFIA
WiFi 开关、切换、查询状态(开关需 Shizuku 或 root(Android 10+ 系统 API 对普通应用无效);status 不需要)。输出:wifi_success, wifi_enabled, wifi_state。wifi_state 是 WifiManager 数字码:0=关闭中 1=已关 2=开启中 3=已开 4=未知;开启中也算 wifi_enabled=true。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: action (required), require, on_error, node_timeout_ms.
ACTION_WORKSPACEB
读写本机工作区条目(结果、笔记、图片),用户在 App「工作区」页查看。输出:workspace_id, workspace_kind, workspace_content, workspace_path, workspace_list, workspace_count, workspace_name, workspace_success, workspace_error。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: id, tag, kind, name, +11 more.
agent_startA
启动自主循环。arguments: goal(必填), provider(jev/deepseek/local,可空), max_steps(1-40,默认 20,可空), planner(true/false,可空,覆盖界面开关)。配了 DeepSeek key 且开启规划时,先由 DeepSeek 拆步骤、最后复核
Inputs: no named parameters.
agent_statusC
自主循环状态与最近步骤
Inputs: no named parameters.
agent_stopC
停止自主循环
Inputs: no named parameters.
CONDITION_ADVANCED_SWITCHA
高级条件分支:表达式先插值,两边都可以是变量或字面值。插值后每一侧若是已定义的变量名就取其值,否则当字面值;数字比较只认数字类型变量,字符串变量请写成 ${var}。contains/startswith/endswith 不区分大小写且两侧要有空格;内置 is_daytime / is_nighttime(8:00–17:59 为白天)。分支写在 branches(true/false → 节点 id),不走 next。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: var, value, require, on_error, +3 more.
CONDITION_SWITCHA
按条件表达式走 true / false 分支。运算符 ==、!=、>、<、>=、<=、contains、startswith、endswith;== / != 按字符串比较,> < >= <= 按数字比较(非数字当 0),contains/startswith/endswith 不区分大小写。左边是变量名(不要写 ${}),右边是字面值,值不加引号;> 和 < 两侧必须有空格;未定义变量按字符串 null 比较。分支写在节点的 branches(true/false → 节点 id),不走 next,缺的分支即该路径结束。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。
Inputs: expression (required), require, on_error, node_timeout_ms.
debug_screenB
排查用:当前观测快照 + 候选动作清单。arguments: goal(可空,默认「打开设置」)
Inputs: no named parameters.
mini_screen_statusB
悬浮小屏当前内容(是否显示、标题、来源、文字、进度),只读
Inputs: no named parameters.
pingC
连通性测试
Inputs: no named parameters.
screenB
获取当前屏幕无障碍树文本 + 前台应用包名(AI 的眼睛)
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 78 tools
Most tools target a distinct device capability, and the descriptions work hard to separate near-neighbors (e.g. ACTION_GET_APP_INFO explicitly defers to ACTION_FOREGROUND_APP for a shell fallback). However there are several genuinely confusable pairs: ACTION_GLOBAL_KEY vs ACTION_GLOBAL_NAV both expose back/home/recents/notifications, ACTION_GET_TIME vs ACTION_PARSE_DATETIME both return date parts, and ACTION_TOAST vs ACTION_SEND_NOTIFICATION vs ACTION_DYNAMIC_ISLAND vs ACTION_MINI_SCREEN are four different ways to surface output to the user. With 78 tools an agent will often need to read descriptions closely before picking.
The bulk of the surface uses an ACTION_* SCREAMING_SNAKE prefix, which is a clear and readable convention. But it is mixed with lowercase control tools (agent_start, agent_stop, agent_status, screen, debug_screen, ping, mini_screen_status) and unprefixed uppercase condition nodes (CONDITION_SWITCH), so there are effectively three naming families with no rule an agent can predict.
78 tools is far past the point where an agent can hold the surface in mind; selection becomes a search problem rather than a choice. The domain (full Android device automation) is genuinely broad and most tools are non-redundant, so it is not gratuitous padding, but the set is still drastically over-scoped for a single MCP surface.
Coverage is unusually thorough: UI observation and interaction, system/device state reads, radios, media, notifications, variables, arrays, math, text, JSON/XML parsing, HTTP, loops, retry, try/catch, and both condition branch types. Gaps are minor — no file read/write node despite error hints referencing file_success, and no SMS/call-placing action to pair with the call-state waits.
Maintenance
Related MCP Connectors
Let Claude, ChatGPT and other agents use your Android phone: see the screen, tap, type, open apps.
Melaya is a remote MCP server. It gives an assistant hands on your own Android phone and browser: it reads the screen through the accessibility tree, then taps, types and navigates inside the apps and sites you allow-list, with no per-app API. It also builds, schedules and runs agent pipelines across 6k+ connected tools. OAuth 2.1, nothing to install.
AI agents on your own iPhone or Android: run tasks in real apps, read the screen, tap and type.
Remote MCP server that lets AI assistants operate your own Android phone (Android 11+, no root) with per-app allowlists, on-phone approval, hidden verification codes, and mandatory confirmation for banking and payment apps that Tongs recognizes.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA MCP server that enables LLMs to control Android devices via ADB, supporting input, UI hierarchy, device management, and shell commands.16MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that lets AI agents control iOS and Android devices (tap, scroll, type, take screenshots, read UI trees, and run code). Works with multiple devices at the same time.100 npm54MIT
- AlicenseBqualityBmaintenanceGive any LLM agent a real Android or iPhone. 62 MCP tools: tap, swipe, type, screenshot, screen-tree reading, app launch, camera, TTS, crash reports, batched execution. Android via ADB, iPhone via WebDriverAgent, on-device inference, Docker+KVM emulators. Works with Claude Code, Cursor, LangChain, LlamaIndex, and any MCP client. MIT.66430MIT
- AlicenseNot gradedqualityCmaintenanceControls Android and iOS devices from AI agents through a token-efficient MCP server, enabling observation, tapping, typing, gestures, navigation, assertions, and safety-gated actions.2MIT