Sandbox
@mikepenz/adbfriend

ADB CLI and MCP server for Android devices

ADB Friend gives you a small command-line layer over Android ADB, plus an MCP server that AI tools can call. It covers device info, app management, file transfers, screenshots, and test setup actions like disabling animations.

75 stars5 forksKotlinUpdated 14d ago
Who it's for

Builders who want their agent or terminal to manage Android devices through ADB and MCP.

What it delivers

You can control an Android device, move files, and run test setup steps without leaving your agent workflow.

What it does

Device and package management

Lists connected devices and installed packages, uninstalls apps by pattern, force-stops packages, clears app data and cache, and sets the immersive flag.

File operations on device

Lists, reads, writes, moves, copies, deletes, creates, and searches files and directories on the Android device.

Test setup actions

Prepares devices for development by disabling animations, enabling touches, and syncing test data from your computer.

MCP server for AI tools

Exposes ADB actions as MCP tools such as `get-connected-devices`, `read-file`, `write-file`, and `install-apk`.

Connection speed check

Includes `adb-speed` to help spot slow or poor USB cables.

How to get it

  1. 1The installation can be performed using Homebrew. First you'll require the custom tap
    brew tap mikepenz/tap
  2. 2Next, install the AdbFriend CLI
    brew install mikepenz/tap/adbfriend
  3. 3ADB Friend is a command line tool, which can be used in a terminal.
    # Get started with the `--help` command, to get information and an overview on the various features offered.
    adbfriend --help

README

ADB Friend

ADB Friend is a tiny cli tool, which helps you to manage your Android device via ADB. Its features were mostly designed for developers, but it can be useful for everyone.

Features

  • Sync files from your computer to your phone
    • Designed for test data, skipping existing files on device
  • Configure device for tests
    • Disable animations, Enable touches, ...
  • Uninstall apps by pattern
  • Packages command
    • Apply the immersive flag to all packages matching glob, force-stop, clear app data & cache
  • Extra tools
    • adb-speed (Helps to identify sub-par cables)
  • Model Context Protocol MCP Server

Install

The installation can be performed using Homebrew. First you'll require the custom tap:

brew tap mikepenz/tap

Next, install the AdbFriend CLI:

brew install mikepenz/tap/adbfriend

Alternatively, you can download prebuild binaries for release page.

Usage

ADB Friend is a command line tool, which can be used in a terminal.

# Get started with the `--help` command, to get information and an overview on the various features offered.
adbfriend --help

MCP Server

ADB Friend (Since version 1.4.0) also provides a Model Context Protocol (MCP) Server, that can be configured in popular AI Tools like Claude Desktop, GitHub Copilot, RayCast, ...

Configuration

The location and details of the configuration file will depend on the used tool. Below example for Claude Desktop.

{
  "mcpServers": {
    "adb-friend": {
      "command": "/opt/homebrew/bin/adbfriend",
      "args": [
        "mcp",
        "server"
      ],
      "env": {
        "ANDROID_HOME": "/Users/mikepenz/Development/android/sdk"
      }
    }
  }
}

[!IMPORTANT]
If ANDROID_HOME is not provided, the adb-server has to be manually started on your machine. Otherwise, a connection exception is thrown.

Debug Server

You can use the npx @modelcontextprotocol/inspector to debug the server once started.

# Install and run inspector in your terminal
npx @modelcontextprotocol/inspector

Then launch the website (with the url as provided in the terminal). Launch the mcp server using IntelliJ or the actual command.

# Default port is `3001`
adbfriend mcp server --sse true

Supported tools

Tool NameDescription
check-adb-speedChecks the USB connection speed of an Android device for the provided serial.
clear-installed-packageClears the package data for provided package names on an Android device.
set-immersive-full-for-packageSets the 'immersive-full' flag for provided package names on an Android device.
force-stop-processForces the stop of provided package names on an Android device.
uninstall-packageUninstalls provided package names on an Android device.
get-connected-devicesRetrieves information about all connected Android devices including serial, model, and state.
get-installed-packagesRetrieves information about all installed packages on an Android device. Supports filtering for third-party apps only.
list_allowed_directoriesLists directories that are allowed to be accessed by the file system tools.
list-filesLists files and directories on an Android device. Supports recursive listing with the 'recursive' option.
read-fileReads the content of a file on an Android device.
read_multiple_filesReads the contents of multiple files on an Android device at once (reduces LLM calls).
write-fileWrites content to a file on an Android device.
create-directoryCreates a directory on an Android device.
deleteDeletes a file or directory on an Android device.
search-filesSearches for files matching a case-insensitive glob pattern within allowed directories.
move_fileMoves a file from the source path to the destination path on an Android device.
copy-file-to-hostCopies a binary file from the Android device to the host system.
capture-screenshotCaptures a screenshot from an Android device and saves it to the host system.
install-apkInstalls an APK on the Android device from a file on the host system within the allowed host paths.

With many more tools planned for the future.

Example Prompts

uninstall the 'sample' app, but keep its data
force stop the 'sample' app
Do I have a browser installed on the connected emulator?
Organize all files in the Download folder of the connected Android device
 Pull all KotlinConf related files from the Android device to the host

Release

The project uses shadow to package the tool in a fat-jar, and also do minimal minification.

./gradlew adbfriend-cli:shadowDistZip

Other

AboutLibraries

Generate aboutlibraries.json for adbfriend

./gradlew adbfriend:exportLibraryDefinitions

Generate aboutlibraries.json for adbfriend-cli

./gradlew adbfriend-cli:exportLibraryDefinitions

Example Prompt Screenshots

Claude Desktop claude-desktop-sample-prompt

Visual Code visual-code-sample-prompt.png

Credits

This project uses the amazing adam library from Malinskiy to interact with adb. The CLI is set-up using the impressive clikt library from ajalt.

License

Copyright 2025 Mike Penz

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Files in the repo

Repository payload16 top-level entries
  • .github
  • .run
  • adbfriend
  • adbfriend-cli
  • gradle
  • shared
  • .gitignore
  • build.gradle.kts
  • gradle.properties
  • gradlew
  • gradlew.bat
  • LICENSE
  • manifest.json
  • README.md
  • renovate.json
  • settings.gradle.kts

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More connectors

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

43k

Universal provider proxy for OpenAI Codex & Claude Code — use any LLM (Claude, Gemini, Grok, DeepSeek, Ollama…) with Codex CLI, App, SDK, and Claude Code

14k
okf-memory/
okf-agent-memory

Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.

547
tirth8205/
code-review-graph

Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.

31k
2akouwu/
reverify

Stop your AI from making things up — it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.

1.1k
t8y2/dbxConnectors

20 MB lightweight cross-platform database client for 90+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 90+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP Server。

19k