Skip to main content
Glama

deploy_and_verify_apk

Installs a local APK, cold-launches the target app, then returns crash stacks, Logcat, LSPosed logs, and UI hierarchy to verify deployment and hook behavior in one call.

Instructions

【Android / LSPosed 开发一键联调闭环】 单次调用自动完成:

  1. 安装本地 APK (adb install -r -d)

  2. 记录日志起始时间,保留全局 Logcat 缓冲池

  3. 强杀并冷启动目标宿主应用 (am force-stop + 启动)

  4. 等待页面渲染与 Hook 注入

  5. 自动汇总返回:是否有 Crash 堆栈 + 目标应用 Logcat + LSPosed 模块最新日志 + 当前屏幕 UI 控件树!

Input Schema

NameRequiredDescriptionDefault
apk_pathYes本地电脑上编译好的 APK 绝对路径
log_keywordNo可选:过滤提取日志的关键词
wait_secondsNo启动后等待钩子执行与页面加载的秒数,默认 3.5 秒
target_packageYes安装后需要强杀并冷启动验证的目标包名(如果是调试 LSPosed 模块,填宿主包名如 'com.example.app';如果是普通 App,填自身包名)
launch_activityNo可选:指定启动的具体 Activity

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations supplied, the description carries the burden and discloses the important side effects: install uses -r -d (reinstall with downgrade), the target app is force-stopped and cold-started, and the global logcat buffer is retained. It does not cover permissions, adb/root prerequisites, or expected duration/failure modes, but the destructive footprint of the operation is made visible.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The header line establishes scope up front, followed by a numbered list of the five automated steps. Each item adds information; only the decorative bracket styling is noise. It is slightly long but front-loaded and scannable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a five-parameter, multi-step orchestration tool with an output schema, the description explains the sequence, what gets killed, and what is aggregated back (crash stack, logcat, LSPosed module logs, UI tree). Missing only prerequisites and failure handling, which leaves a small gap given no annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so apk_path, target_package, log_keyword, wait_seconds, and launch_activity are already documented in the input schema. The description adds no parameter-specific meaning beyond that, which matches the baseline for fully covered schemas.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a concrete multi-step workflow (install → capture logcat → force-stop/cold start → wait for hook → aggregate crash logs, module logs, UI tree) and titles it as an Android/LSPosed one-shot debug loop. That clearly separates it from single-purpose siblings such as adb_command, read_logcat_smart, and get_ui_tree.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It establishes the context in which it is the right tool: an LSPosed/Android development iteration where the agent needs install-and-verify in one call, and it notes that for module debugging the target_package is the host app. It does not name explicit alternatives or state when not to use it (e.g. use adb_command for a plain install without verification).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.