Skip to content

Add recents (incl. accessibility) and force_stop/restart_app MCP tools - #13

Merged
leeguooooo merged 1 commit into
mainfrom
fix/issue-2
Nov 19, 2026
Merged

leeguooooo merged 1 commit into
mainfrom
fix/issue-2

Conversation

@leeguooooo

Copy link
Copy Markdown
Owner

Refs #2

What this adds on top of the existing adb recents|force-stop|restart (bc7b028):

  • POST /agent/device daemon endpoint, behind the lease: {"command":"recents"}, {"command":"force_stop"|"restart_app","package":"..."}.
    • ADB backend: input keyevent KEYCODE_APP_SWITCH, am force-stop, then a relaunch.
    • Accessibility backend: recents calls a new companion RPC recents (GLOBAL_ACTION_RECENTS). force_stop/restart_app return adb_required with outcome:not_sent, because Android does not let an accessibility service stop another app.
    • Older companions reject the unknown method, and that comes back as companion_outdated (not sent). Nothing gets mapped to home.
  • MCP tools phone_recents, phone_force_stop, phone_restart_app.
  • CLI: android-use adb recents falls back to the companion when there is no ADB and the daemon backend is accessibility. force-stop/restart give a clearer adb_required message.
  • Companion: PocketService handles recents. pressKey now refuses keys other than back/home. The native whitelist allows recents.
  • Capabilities list device_commands. README and the skill are updated.
  • Tests: device-command parsing and package validation; accessibility recents end to end through the TLS bridge; force_stop/restart_app refused without anything reaching the phone.

Not done, so this is Refs rather than Fixes:

  • recents is not an act/flow step type. That needs a new Action in vendored shared/control, which has to go through upstream iphone-use first.
  • The companion change has not been tried on a real device. cargo test passes.

…MCP tools

Adds POST /agent/device (recents, force_stop, restart_app) behind the lease.
Accessibility backend opens recents via GLOBAL_ACTION_RECENTS; force_stop and
restart_app return adb_required without sending. Older companions return
companion_outdated. CLI adb recents falls back to the companion without ADB.

Refs #2
@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d65fae24-f62c-4c57-b9f6-89570a49b477
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@leeguooooo
leeguooooo merged commit ea59eac into main Nov 19, 2026
9 checks passed
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