Getting Started
Pick a stack
rsbinder ships two, and which one you can use depends on the platform:
- Kernel binder — Linux 5.0+ with binderfs enabled, or Android. Talks to
the kernel driver through
/dev/binderfs/binder(Linux) or/dev/binder(Android). This is what most of this guide covers. - RPC transport (binder-over-socket, opt-in via the
rpcfeature) — pure user-space, no kernel driver, no root. Runs on Linux, Android, and macOS, over Unix-domain sockets, vsock, or TLS. See RPC Transport.
macOS has no binder driver, so only the RPC stack works there — enough to develop and test RPC services on a workstation without a Linux VM. Windows is not supported on either stack.
Before you start
- Rust 1.86 or later
- For kernel binder: a kernel with binder support, or an Android device/emulator
-
For kernel binder on Linux: a device node created with
rsb_device, andrsb_hubrunning as the service manager
Installation walks through all of these.
The workflow
- Define the interface — an
.aidlfile, or a Rust trait with#[rsbinder::interface]. - Generate the Rust from it (
rsbinder-aidlin abuild.rs; the macro needs no build step). - Implement the service.
- Register it and connect to it —
rsbinder::serve(uri)andrsbinder::connect(uri).
Hello, World! does all four end to end, and is the fastest way to see where each piece fits.