Skip to content

Wi-Fi over ADB: pairing, auto-connect, catch-up and reconnect - #6

Merged
Qwinty merged 3 commits into
mainfrom
claude/wifi-adb-connection-91d758
Sep 29, 2026
Merged

Qwinty merged 3 commits into
mainfrom
claude/wifi-adb-connection-91d758

Conversation

@Qwinty

@Qwinty Qwinty commented Sep 29, 2026

Copy link
Copy Markdown
Owner

Adds Wi-Fi over ADB. The phone no longer needs a cable after the first setup.

What's in it

  • "Phones and Wi-Fi" panel: pairing by QR code or six-digit code (Android 11+), "From cable" (adb tcpip 5555, with a warning that the link isn't encrypted), connecting by address, and picking or forgetting a phone.
  • Discovery and auto-connect: phones are found over mDNS, and remembered phones connect by themselves when they show up on the network. The chosen phone is stored by its Wi-Fi id, so a new address after a reconnect doesn't lose the choice. adb's " (2)" suffix is ignored.
  • Stream over Wi-Fi:
    • a key frame every second;
    • 6 Mbit/s at start, lowered on congestion and raised again after clean minutes;
    • when the picture falls more than 500 ms behind, frames are skipped to the next key frame, so delay doesn't pile up.
  • Reconnect: up to 5 attempts while apps keep the last frame. Sessions that keep failing back off, and the reconnect path has stop checks and short timeouts.
  • VPN on the phone: the phone doesn't announce itself over mDNS and shows the VPN address. After pairing, the app pre-fills the phone's Wi-Fi IP for "Connect by address". If a typed address fails, the app retries the same port on the phone's known Wi-Fi IPs and drops the offline connection left behind.
  • Forget: the phone is disconnected and not picked again, including after an app restart. The UI explains that unpairing is done on the phone.
  • New strings in all 13 languages, docs/SPEC.md §2.4, and draft notes in docs/releases/v0.2.0.md. The version is not bumped.

Checks

  • cargo test --lib: 84 passed (after merging main), pnpm check: 0 errors. clippy shows no new warnings.
  • Two rounds of independent review; everything flagged is fixed, except two minor edge cases below.
  • On a OnePlus 11R (Android 15), with a VPN on the phone:
    • pairing by code: the phone was found over mDNS and paired;
    • after pairing, the Wi-Fi IP was pre-filled and connecting by port worked;
    • connecting by the VPN address 26.26.26.1:port fell back to 192.168.3.237:port;
    • reconnect: the "Reconnecting (N of 5)" status showed, then it went back to the cable;
    • 5 minutes of streaming over Wi-Fi: 30 fps, one catch-up from 515 ms back to 20 ms.
  • Pairing by QR was not tested on the phone: only the phone's camera can scan the code. It uses the same adb pair/connect.

Known limitations

  • The address of a phone switched over "From cable" can go to another device after the router reassigns it; nothing checks it is the same phone.
  • When the app switches to another phone, the lens and size can carry over from the previous one.

Qwinty and others added 3 commits September 29, 2026 11:44
- Phones and Wi-Fi panel: pair by QR code or six-digit code (Android 11+), move a
  cable-connected phone to Wi-Fi (adb tcpip), connect by address, pick or forget a phone
- mDNS discovery; paired phones connect by themselves when they show up; the chosen
  phone is stored by its Wi-Fi id, so a new address after a reconnect keeps the choice
- Wi-Fi stream profile: key frame every second, 6 Mbit/s start, steps down on
  congestion and back up after clean minutes; skips to the next key frame when the
  picture falls 500 ms behind, so delay never piles up
- Reconnect up to 5 times while apps keep the last frame; back-off for sessions that
  keep failing; stop checks and short timeouts inside the reconnect path
- VPN on the phone: after pairing, pre-fill the phone's Wi-Fi IP for connecting by
  address and retry the same port on known Wi-Fi IPs; drop half-open transports
- adb devices -l parsing with spaces in mDNS names; adb's " (2)" name suffix ignored
- New strings in all 13 languages; SPEC 2.4 and draft notes for the next release

Tested on a OnePlus 11R (Android 15): pairing by code, connect by the VPN address,
reconnect, and 5 minutes of streaming over Wi-Fi at 30 fps.

Co-Authored-By: Claude <noreply@anthropic.com>
…ction-91d758

# Conflicts:
#	app/src/lib/api.ts
#	src-tauri/Cargo.lock
#	src-tauri/Cargo.toml
#	src-tauri/src/app/controller.rs
#	src-tauri/src/app/mod.rs
#	src-tauri/src/settings.rs
@Qwinty
Qwinty merged commit 0edb2cb into main Sep 29, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant