MCPcopy Index your code
hub / github.com/cocool97/adb_client

github.com/cocool97/adb_client @v3.2.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v3.2.2 ↗ · + Follow
498 symbols 1,014 edges 138 files 150 documented · 30%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Android Debug Bridge (ADB) client implementation in pure Rust !

    <a href="https://crates.io/crates/adb_client">
        <img alt="crates.io" src="https://img.shields.io/crates/v/adb_client.svg"/>
    </a>
    <a href="https://crates.io/crates/adb_client">
        <img alt="msrv" src="https://img.shields.io/crates/msrv/adb_client"/>
    </a>
    <a href="https://github.com/cocool97/adb_client/actions">
        <img alt="ci status" src="https://github.com/cocool97/adb_client/actions/workflows/rust-build-matrix.yml/badge.svg"/>
    </a>
    <a href="https://deps.rs/repo/github/cocool97/adb_client">
        <img alt="dependency status" src="https://deps.rs/repo/github/cocool97/adb_client/status.svg"/>
    </a>
    <a href="https://opensource.org/licenses/MIT">
        <img alt="dependency status" src="https://img.shields.io/badge/License-MIT-yellow.svg"/>
    </a>

Main features of this library:

  • Full Rust, don't use adb * shell commands to interact with devices
  • Supports
  • Using ADB server as a proxy (standard behavior when using adb CLI)
  • Connecting directly to end devices (without using adb-server)
    • Over USB
    • Over TCP/IP
  • Implements hidden adb features, like framebuffer
  • Highly configurable
  • Provides wrappers to use directly from Python code
  • Easy to use !

adb_client

Rust library implementing both ADB protocols (server and end-devices) and providing a high-level abstraction over the many supported commands.

Improved documentation available here.

examples

Some examples showing of to use this library are available in the examples directory:

  • examples/mdns: mDNS device discovery
  • examples/python_api: demonstrates the use of Python API

adb_cli

Rust binary providing an improved version of Google's official adb CLI, by using adb_client library. Provides a "real-world" usage example of this library.

Improved documentation available here.

pyadb_client

Python wrapper using adb_client library to export classes usable directly from a Python environment.

Improved documentation available here

Related publications

Some features may still be missing, all pull requests are welcome !

Extension points exported contracts — how you extend this code

ADBTransport (Interface)
Trait representing a transport usable by ADB protocol. [4 implementers]
adb_client/src/adb_transport.rs
ADBDeviceExt (Interface)
Trait representing all features available on ADB devices. [4 implementers]
adb_client/src/adb_device_ext.rs
BinaryDecodable (Interface)
Internal trait representing binary decoding capabilities. [3 implementers]
adb_client/src/message_devices/utils.rs
BinaryEncodable (Interface)
(no doc) [4 implementers]
adb_client/src/message_devices/utils.rs
ADBMessageTransport (Interface)
Trait representing a transport able to read and write messages. [2 implementers]
adb_client/src/message_devices/adb_message_transport.rs

Core symbols most depended-on inside this repo

as_bytes
called by 31
adb_client/src/message_devices/adb_transport_message.rs
get_raw_connection
called by 30
adb_client/src/server/tcp_server_transport.rs
read_next
called by 25
adb_client/src/models/framebuffer_info.rs
proxy_connection
called by 24
adb_client/src/server/tcp_server_transport.rs
set_serial_transport
called by 24
adb_client/src/server_device/adb_server_device.rs
read_message
called by 22
adb_client/src/message_devices/adb_message_transport.rs
header
called by 18
adb_client/src/message_devices/adb_transport_message.rs
send_adb_request
called by 17
adb_client/src/server/tcp_server_transport.rs

Shape

Method 377
Class 49
Function 37
Enum 30
Interface 5

Languages

Rust100%
Python1%

Modules by API surface

adb_client/src/message_devices/usb/adb_usb_device.rs24 symbols
adb_client/src/server_device/adb_server_device_commands.rs20 symbols
adb_client/src/message_devices/tcp/tcp_transport.rs20 symbols
adb_client/src/message_devices/adb_transport_message.rs20 symbols
adb_client/src/message_devices/tcp/adb_tcp_device.rs18 symbols
adb_client/src/message_devices/usb/usb_transport.rs16 symbols
adb_client/src/server/tcp_server_transport.rs15 symbols
adb_client/src/message_devices/adb_message_device_commands.rs15 symbols
pyadb_client/src/adb_usb_device.rs14 symbols
adb_client/src/message_devices/models/adb_rsa_key.rs12 symbols
adb_client/src/message_devices/adb_session.rs11 symbols
pyadb_client/src/adb_tcp_device.rs10 symbols

For agents

$ claude mcp add adb_client \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact