Your Android phone, fully connected to your Linux desktop.
Mirror the screen. Send files in either direction. Use the phone's camera as a webcam in Zoom, OBS, or Discord. Type with your PC keyboard on the phone. Copy from one, paste on the other. Open a link on one, watch it open on the other. All over Wi-Fi, no cables once paired.
It's what scrcpy could be if it grew up.
- Mirror your phone screen to a window on your desktop.
- Click, type, and drag on that window — the phone responds.
- Use the phone's camera as a webcam in any Linux app that picks a v4l2 camera (Chromium-based browsers, Firefox, OBS Studio, Discord, Zoom, Google Meet, ...). The phone shows up by its actual model name in the camera picker.
- Use the phone's microphone as a Linux audio source.
- Hear PC audio on the phone (and vice versa) over the same Wi-Fi link.
- Send a file from anywhere on Linux to the phone (
ansyncctl push file.pdf) or via a desktop file-manager menu. - Share files from the phone to the PC using Android's built-in share sheet — pick "Send via ansync".
- Share a link in either direction: it opens automatically on the other side (the phone asks first, the PC opens it straight away).
- Sync the clipboard both ways: copy on the phone, paste on the PC.
- See phone notifications on the desktop, mirrored in real time.
Everything is end-to-end encrypted between your phone and your computer. No cloud, no Anthropic account, no Google account — once paired, the two devices find each other on your home Wi-Fi and talk directly.
{
inputs.ansync.url = "github:SergioRibera/ansync";
outputs = { self, nixpkgs, ansync, ... }: {
nixosConfigurations.myhost = nixpkgs.lib.nixosSystem {
modules = [
ansync.nixosModules.default
{
services.ansync = {
enable = true;
user = "alice"; # whichever user runs the desktop
};
}
];
};
};
}Rebuild your system, log out and back in. The daemon (ansyncd) starts
automatically with your desktop session.
Home Manager (non-NixOS distros that already use Home Manager):
home.imports = [ ansync.homeManagerModules.default ];
programs.ansync.enable = true;The daemon ships as a single binary. You'll need a few things from your package manager first:
- PipeWire (or ALSA)
v4l2loopbackkernel modulewl-clipboard(Wayland) orxclip(X11)xdg-utils(so links open viaxdg-open)
Then:
nix develop # or set up Rust 1.85+ and pkg-config / libclang manually
cargo build --release
sudo install -Dm755 target/release/ansyncd /usr/local/bin/ansyncd
sudo install -Dm755 target/release/ansyncctl /usr/local/bin/ansyncctl
sudo install -Dm644 bins/ansyncd/contrib/60-ansync-uinput.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && sudo udevadm trigger
sudo modprobe v4l2loopback devices=0
sudo usermod -aG input,video $USER # log out / log back inMake sure your firewall lets UDP 5353 (mDNS) and UDP 47215 (the daemon's
encrypted port) through:
# firewalld
sudo firewall-cmd --add-port=47215/udp --permanent && sudo firewall-cmd --reload
# ufw
sudo ufw allow 47215/udpIf you used the NixOS module, the firewall is already open.
You install the companion app once, from your PC, the first time you pair. There is no need to download an APK by hand — see the next section.
-
On the phone: enable Developer Options (tap the build number 7 times in Settings) and turn on USB Debugging.
-
Plug the phone into the PC with a USB cable.
-
On the PC, run:
ansyncctl pair
That's it. Behind the scenes, ansync downloads the latest companion app, installs it, exchanges encryption keys, grants the required permissions, and registers the phone with the daemon. The whole thing takes about 15 seconds.
After this, unplug the cable. The two devices find each other on your Wi-Fi from now on.
You'll see a setup notification on the phone walking you through one-time grants (screen capture access, accessibility for remote input, notification access). Tap through them once and they're remembered.
Once the phone is paired and on the same Wi-Fi:
From your PC:
# Find the device id (32 hex characters)
ansyncctl devices
# Open the mirror window
gdbus call --session --dest org.gameros.Ansync1 \
--object-path /org/gameros/Ansync1/Device/<ID> \
--method org.gameros.Ansync1.Device.ShowScreenA window pops up with the phone's screen. Click, drag, type — the phone responds in real time. Close the window to stop.
(A friendly GUI / system-tray launcher is planned — for now, the GNOME
extension and KDE plasmoid in the works are the easy path; the
gdbus invocation is the underlying mechanism.)
gdbus call --session --dest org.gameros.Ansync1 \
--object-path /org/gameros/Ansync1/Device/<ID> \
--method org.gameros.Ansync1.Device.StartCamera \
"0" 1920 1080 30 6000 "h264" "letterbox" falseNow open Chromium, Firefox, OBS, Discord, Meet, ... and pick the camera
<Your Phone> (Ansync) in the device list. Done.
Lens id "0" is the rear camera on most phones; "1" is the front. The
five numbers are width height fps bitrate-kbps, then codec
(h264 or h265), aspect (crop / letterbox / stretch), and whether
to enable image stabilisation (true / false).
Stop with StopCamera.
gdbus call --session --dest org.gameros.Ansync1 \
--object-path /org/gameros/Ansync1/Device/<ID> \
--method org.gameros.Ansync1.Device.StartMicrophoneA new PipeWire source appears: pick it in your audio settings. Stop with
StopMicrophone.
ansyncctl push <device-id> ~/Documents/notes.pdf ~/Pictures/cat.pngThe phone gets a notification you can tap to open the file.
On the phone, open any file (a photo, a PDF, anything), tap the Share button, and choose Send via ansync from the share sheet. A desktop notification appears on the PC when it arrives.
You can also tap the Send to PC Quick Settings tile on the phone to pick any file without opening a specific app.
PC → phone:
ansyncctl url <device-id> "https://example.com"The phone shows a "Open this link from your PC?" notification — tap and the link opens.
Phone → PC: just share the link from any app via Send via ansync. It opens immediately on your desktop (the phone is already trusted).
Both sync automatically once you're paired. You can tighten or loosen what gets shared per-device under Permissions (see below).
Every feature is gated per device. The first time you pair, the safe defaults are on: screen mirror, file transfer, notifications, clipboard. Things that grant access to hardware (camera, microphone, virtual keyboard / mouse) start off — flip them on explicitly.
ansyncctl perm <device-id> camera_video on
ansyncctl perm <device-id> mic onOr edit ~/.config/ansync/devices/<device-id>.toml directly.
Available switches:
The phone never connects ("Disconnected" forever, even after pair).
Make sure UDP 47215 is open on your PC's firewall. On NixOS with the
module enabled this is automatic.
Camera picker doesn't show "(Ansync)". Check lsmod | grep v4l2loopback.
If you see the module loaded with devices=N video_nr=..., reload it with
devices=0: sudo modprobe -r v4l2loopback && sudo modprobe v4l2loopback devices=0.
The dynamic mode gives every paired phone its own named entry.
Microphone silent or no sound coming through. Open Settings → Sound on
the phone, confirm RECORD_AUDIO is granted to the ansync companion. On the
PC, pactl list short sinks should list the ansync sink.
Mirror window opens but is blank. On the phone, tap the "Mirroring to PC" tile in Quick Settings (or pull down the shade and grant screen capture from the heads-up notification).
Pair fails with "companion did not connect in time". Make sure USB debugging is enabled and the cable is data-capable. Some charge-only cables look fine but don't carry data.
Logs
journalctl --user -u ansyncd -f # PC daemon
adb logcat -s ansync ansync.svc ansync.camera ansync.audio # phoneThe PC runs a small daemon (ansyncd) that listens for the phone on the
local network. The phone runs a background service that finds the daemon
over mDNS and connects with QUIC (the same encrypted transport HTTP/3
uses). The keys exchanged when you paired are pinned on both ends, so
nothing but those two specific devices can decrypt the traffic. Every
feature — screen, camera, audio, files, clipboard — is a separate
multiplexed stream on that single QUIC connection.
No cloud. No accounts. No telemetry. No ffmpeg, no OpenSSL — codecs are
hardware NVENC / VAAPI with a pure-Rust software fallback, and crypto is
rustls with custom public-key pinning.
The full design notes, roadmap, and per-feature breakdown live in
PLAN.md. The session-to-session conventions for working on
the codebase live in CLAUDE.md. The Android companion
app's build / layout notes are in android/README.md.
The codebase is a Rust workspace (crates/* for libraries, bins/* for
the daemon and CLI) plus a Kotlin Android app under android/ that links
a Rust cdylib via JNI.
nix develop # all build deps
cargo build --workspace
cargo test --workspacePull requests welcome.
MIT OR Apache-2.0
