Skip to content

Latest commit

 

History

History
376 lines (235 loc) · 20.1 KB

File metadata and controls

376 lines (235 loc) · 20.1 KB

AirSend Icon

🚀 AirSend

Views Total Downloads GitHub stars Latest Release License: MIT Platform: macOS Platform: Android Swift: 6.2 Kotlin: 1.9.23 Rust: 1.93.1

English | 简体中文

❤️ Support AirSend

🤔 What is this?

AirSend is a cross-platform connectivity tool designed for Mac + Android users. The core goal is simple: make file transfers and clipboard sync as effortless as AirDrop — without needing two Apple devices.

It consists of two parts:

  • macOS side: A natively-built Swift menu bar app, ~20MB RAM, no main window, drag-and-drop to send
  • Android side: Choose as needed — use the official LocalSend directly, or install the AirSend custom app for system-level deep integration

Network requirement: Both devices must be on the same Wi-Fi LAN, with AP isolation disabled on the router. HTTPS remains the default path; if you are on a campus or dorm network where discovery works but transfers stall, see the HTTP Compatibility Mode section below.


⚖️ How it compares to similar tools

Feature Official LocalSend KDE Connect Official AirDrop AirSend
macOS UI ✅ Flutter cross-platform main window ✅ Menu bar / pairing manager ✅ Native system share entry ✅ Pure Swift native menu bar, no main window
RAM Usage ~300MB Moderate, resident components ✅ Built into the system, no main window ~20MB
Clipboard Sync ✅ Manual / plugin-style sync ✅ Universal Clipboard between Apple devices ✅ Two-way automatic (Android ↔ Mac)
Screenshot Auto-Push ✅ Screenshots appear in Mac Downloads instantly
Image Clipboard Sync ✅ Universal Clipboard inside Apple ecosystem ✅ Copied images on Mac auto-send to Android
Android Background Depends on system process management Depends on Android background policy ❌ No Android support Rust daemon, independent of App lifecycle
System-Level Clipboard ❌ No Android support ✅ (Requires Root + LSPosed)
Drag-and-drop UX ✅ Pop-up drag-and-drop sending
Protocol Compatibility ✅ LocalSend standard ✅ Independent protocol ecosystem ✅ Native Apple ecosystem capability ✅ Fully compatible with LocalSend

✨ Features

📁 File Transfer

Drag files onto the macOS menu bar icon to send. Two modes supported:

  • Broadcast mode: Send to all online AirSend/LocalSend devices on the LAN simultaneously
  • Unicast mode: Select a specific device in the menu to send only to that device

Received files are saved to the Downloads folder via streaming I/O, auto-renamed on conflict (e.g. photo (1).jpg), with no extra memory buffer.

On home routers, mobile hotspots, and other normal LANs, AirSend still defaults to the standard LocalSend-style HTTPS path, so Android users can use the official LocalSend app to transfer files with Mac with no extra configuration.

On campus Wi-Fi, dorm networks, or other policy-heavy LANs, however, official LocalSend often stops at "the device is visible, but the actual transfer never really starts". That is where AirSend's full mode and the HTTP Compatibility Mode below come in.

📋 Two-Way Clipboard Sync

Android → Mac: Copy text on your phone, and the Mac clipboard updates automatically within seconds — no app needed, no popups. Requires full mode (Root + LSPosed).

Mac → Android: Copy anything on Mac, and the Android clipboard syncs automatically. Equally seamless and silent.

Anti-loop design: When synced content is written to the local clipboard, an internal flag is set to prevent triggering another sync cycle. Clipboard temp files (clipboard.txt) received from Android are read and immediately deleted — no trace left on disk.

📸 Screenshot Auto-Send (Android → Mac)

Take a screenshot on Android and it appears directly in your Mac's Downloads folder — without opening any app or manually sharing.

How it works: The Rust daemon uses Linux inotify to continuously monitor screenshot directories. On detecting a new file write, it waits 1 second (for EXT4 page cache flush), then pushes it to Mac via the default HTTPS path or the compatibility HTTP path when needed. Compatible with AOSP native paths and custom ROM paths (MIUI, HyperOS, ColorOS, etc.).

🖼️ Image Clipboard Sync (Mac → Android)

When you copy a screenshot or image on Mac, ClipboardService checks first for TIFF image data in the clipboard, converts it to PNG, and sends it to Android via the default HTTPS path or the compatibility HTTP path when needed.

📱 Direct Share Integration

When sharing files on Android, your Mac appears directly in the system's Direct Share target list — like sending to a contact. No need to open AirSend, just tap and send.

🌐 Campus / Complex LAN Compatibility

AirSend 3.0.0 adds a manual, default-off HTTP Compatibility Mode specifically for networks where discovery works but the HTTPS data plane repeatedly times out or hangs.

  • The default remains secure HTTPS mode, so normal home-network usage and standard compatibility with official LocalSend stay intact
  • If devices can discover each other on a campus network but transfers keep stalling, turn on Advanced -> Compatibility Mode (HTTP) in the macOS menu bar
  • Once enabled, macOS exposes a plain-HTTP receive path, and the sender performs a real data-plane preflight before sending so it can choose the path that actually works on that LAN
  • If campus policy suppresses UDP multicast, AirSend can expand discovery by /24 slices across a large subnet and also remember the last reachable device IP for lightweight re-probing and list keepalive
  • In practice, AirSend now addresses not only “device discovered but transfer unusable”, but also “after switching to campus Wi-Fi the phone is missing from the menu again”
  • This compatibility path is an extra AirSend capability built for difficult LANs; official LocalSend does not currently provide it
  • For home routers and mobile hotspots, leaving the default HTTPS mode on is still recommended
  • The compatibility path itself is also tighter now: no silent downgrade by default, better cancellation and timeout cleanup, small-payload fallback boundaries, and session/source binding to reduce packet mixups

📋 Requirements

Platform Requirement
macOS macOS 13 Ventura or later
Android (basic file transfer) Android 8.0+, install official LocalSend
Android (full features) Root + Magisk or KernelSU + LSPosed
Network Both devices on the same Wi-Fi LAN, AP isolation disabled
Firewall Allow UDP 53317 and TCP 53317-53319

✨ AirSend 5.0: Reimagined Across Platforms

Android liquid glass × Material 3 · Native macOS glass console

Android console: status, devices, transfer activity, and deeply customizable Material themes

AirSend Android pink theme

AirSend Android deep green theme

AirSend Android deep purple theme

AirSend 5.0 native macOS glass console

Native macOS glass console: devices, transfers, automation, and complete runtime controls

🎨 One interface, many moods


🕸️ Architecture Overview

The developer-facing diagram below maps AirSend's low-level runtime boundaries, technology stack, IPC, LocalSend-compatible API adapter, and complex-LAN recovery paths.

AirSend low-level engineering architecture


💻 macOS Side

📌 How It Runs

AirSend lives entirely in the menu bar — no Dock icon, no main window. It launches at login by default via SMAppService (macOS 13+).

📂 Drag-and-Drop File Transfer

Drag a file toward the menu bar icon and a frosted-glass DropZone panel appears automatically. Release to immediately initiate a LocalSend handshake; transfer progress is shown in the panel. If no response is received within 8 seconds, the panel minimizes to the menu bar (a white dot appears on the icon) and the transfer continues in the background.

  • Defaults to broadcast (all LAN devices); select a specific device in the menu to switch to unicast
  • Previously connected devices are remembered and stay in the list even when offline
  • Incoming files are auto-accepted and auto-saved with no confirmation popup

📋 Clipboard Monitoring

Mac polls NSPasteboard.general.changeCount every 3 seconds (wake coalescing tolerance: 1.5s):

Change Type Behavior
Image (TIFF) Converts to PNG → sends via ClipboardSender to Android
Plain text Wraps as clipboard.txt → sends via ClipboardSender
Incoming Android text Written to NSPasteboard; temp file deleted immediately, no disk trace

🤖 Android Side

Android supports two modes:

🟢 Basic Mode (No Root Required)

Install the official LocalSend to transfer files with Mac — best compatibility.

For normal home Wi-Fi and hotspots, this is also the recommended starting point.
For campus or dorm networks where devices can be discovered but transfers are still unusable, official LocalSend alone is often not enough; that is where AirSend full mode and HTTP compatibility become relevant.

Not included: clipboard auto-sync, screenshot auto-push, Direct Share shortcuts.

🔴 Full Mode (Root + Magisk/KernelSU + LSPosed)

Installing the AirSend custom App gives you three components:


① Kotlin Foreground Service (AirSendService)

Auto-starts via BootReceiver, runs as a dataSync foreground service (Android 14+ compatible), START_STICKY keep-alive. Polls the Rust daemon every 30 seconds for a device list; only updates Direct Share shortcuts when the list actually changes (avoiding pointless Binder calls).


② Rust Daemon (Magisk/KernelSU Module)

Starts with the system as a Magisk module, fully independent of the App lifecycle:

Responsibility Implementation
Screenshot monitoring inotify on two screenshot dirs, 1s Page Cache delay before push
Device discovery LocalSend UDP broadcast, maintains online device table
IPC bus Two Unix domain sockets: @airsend_ipc / @airsend_app_ipc
Transport resilience HTTPS by default, HTTP compatibility on difficult LANs, rebinding on interface change
Proxy bypass Forces NO_PROXY=* at startup

Monitored screenshot paths:

  • /data/media/0/Pictures/Screenshots (AOSP native)
  • /data/media/0/DCIM/Screenshots (MIUI / HyperOS / ColorOS, etc.)

③ LSPosed Module (Xposed)

Runs in system_server, hooks ClipboardService$ClipboardImpl.setPrimaryClip:

Direction Mechanism
Android → Mac Intercepts copy event → sends via UDS to daemon → HTTPS push to Mac
Mac → Android Listens on @airsend_app_ipc, writes to system clipboard as UID 1000
Anti-loop isWritingFromSync volatile flag, released after 500ms

🚀 Quick Start

💻 Step 1: macOS Setup

  1. For a first install, download the latest macOS ZIP from Releases, then drag AirSend.app into /Applications and open it
  2. Existing users should upgrade with AirSend's Check for Updates action; Sparkle safely quits the old process, atomically replaces the app, and relaunches the new version
  3. Keep Auto-check for updates enabled under Settings → Startup & Updates for future releases

🤖 Step 2: Android Setup

Basic Mode (recommended for non-root users)

Install the official LocalSend. Both devices on the same Wi-Fi and you're ready to transfer files.

If you are testing on a campus or dorm LAN and the devices can see each other but transfers freeze, do not stop at basic mode. Use the full AirSend mode below and manually enable Advanced -> Compatibility Mode (HTTP) on Mac.

Full Mode (root users)

  1. Download the latest Magisk module from Releases
  2. Flash the module in Magisk / KernelSU, then reboot
  3. Enable the AirSend module in LSPosed, scope set to Android System and System Framework, then reboot

After setup, clipboard sync, screenshot auto-send, and Direct Share shortcuts all work automatically.


❓ FAQ

Q: Devices can't find each other?

Confirm both devices are on the same Wi-Fi and that the router doesn't have "AP Isolation" or "Client Isolation" enabled (some routers enable this by default). Firewall must allow UDP 53317 and TCP 53317-53319. Also try clicking Rescan and Refresh in the Mac menu.

On large campus-style subnets, AirSend now first tries remembered-host recovery and then falls back to /24 expansion probing, so the very first recovery can still take a while. Once the device is found again, later keepalive is much faster.


Q: On campus Wi-Fi the devices can discover each other, but every transfer times out or feels unusable. What should I do?

If mobile hotspot or home Wi-Fi works but the campus LAN does not, the problem is usually the campus data plane rather than the devices themselves.

  • Home network / hotspot: keep the default HTTPS mode
  • Campus / dorm LAN: use AirSend full mode and manually enable Advanced -> Compatibility Mode (HTTP) on macOS
  • Official LocalSend: it currently does not provide this manual HTTP compatibility path

Q: After switching to campus Wi-Fi, the phone is missing from the device list, or it appears once and disappears again. What should I do?

AirSend 3.0.0 now has two recovery layers for this:

  • first recovery by /24 expansion across large subnets when multicast is suppressed
  • later keepalive by remembering the last reachable device IP and re-probing it directly

So the first recovery may still take some time, but once the phone is found again the list should stay much more stable. If the campus network uses strict client isolation or fully blocks device-to-device traffic, that is beyond what local compatibility logic can fix.


Q: What's the clipboard sync latency?

Android → Mac: Xposed intercepts the copy event immediately, typically under 0.1 seconds.

Mac → Android: Mac polls every 3 seconds, typical latency under 2 seconds.


Q: Can clipboard sync work without Root?

No. Android 10+ explicitly prohibits background apps from reading the clipboard. Only an Xposed module running in system_server with UID 1000 can bypass this restriction.


Q: Where are received files saved?

  • Mac: ~/Downloads — file name conflicts auto-append a sequence number (e.g. image (1).png)
  • Android: Photos → ~/Pictures/AirSend, other files → ~/Downloads/AirSend

Q: Does screenshot auto-send require the App to be open?

No. The Rust daemon runs as a Magisk module at the system level, independently of whether AirSend App is in the foreground.


Q: Will Mac slow down when sending large files?

No. HTTPTransferServer uses streaming I/O — data is written to disk chunk by chunk without accumulating in memory. Large file transfers have virtually no extra memory pressure.


📈 Star History

AirSend Star History


🤝 Contributing & Feedback

Bug reports and PRs are welcome. If this tool is useful to you, giving it a 🌟 is the most direct way to support the project.


AirSend · Simple is the new smart. AirDrop, but for everyone.


☕ Buy me a coffee

If AirSend has ever made life between your Mac and Android a little easier, you can buy me a coffee.
The amount does not matter—knowing that someone finds it useful already means a lot.

W.W's WeChat appreciation code

❤️ Visit the sponsor page and read the story behind this little project