Metadata-Version: 2.5
Name: symbiolink
Version: 0.5.9
Summary: adb + scrcpy for Symbian S60 3rd Edition phones: symdb CLI and symcast screen mirror over Wi-Fi or USB
Project-URL: Homepage, https://github.com/manojanasuri16/SymbioLink
Project-URL: Repository, https://github.com/manojanasuri16/SymbioLink
Project-URL: Issues, https://github.com/manojanasuri16/SymbioLink/issues
Author-email: Manoj Anasuri <manojanasuri16@gmail.com>
License: MIT
License-File: LICENSE
Keywords: adb,n79,n82,nokia,pys60,retro,s60,scrcpy,screen-mirror,symbian
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Environment :: X11 Applications :: Qt
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Communications
Classifier: Topic :: System :: Hardware
Classifier: Topic :: Utilities
Requires-Python: >=3.9
Requires-Dist: pyqt5>=5.15
Description-Content-Type: text/markdown

# SymbioLink

[![PyPI](https://img.shields.io/pypi/v/symbiolink)](https://pypi.org/project/symbiolink/)
[![Python](https://img.shields.io/pypi/pyversions/symbiolink)](https://pypi.org/project/symbiolink/)
[![Tests](https://github.com/manojanasuri16/SymbioLink/actions/workflows/tests.yml/badge.svg)](https://github.com/manojanasuri16/SymbioLink/actions/workflows/tests.yml)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

**adb and scrcpy, for Symbian.** Android has `adb` (Android Debug Bridge) and
`scrcpy`. SymbioLink brings the same workflow to Symbian S60 3rd Edition phones:

| Android | Symbian (this package) | What it is |
|---|---|---|
| `adb` - Android Debug Bridge | **`symdb` - Symbian Debug Bridge** | command line: connect, files, screenshots, keys, text, device info |
| `scrcpy` | **`symcast`** | live screen mirror with full keypad control |

Both come from one Python package, and talk to the small **SymbioLink** app on
the phone over **Wi-Fi or a USB cable**. The name: *Symbian* comes from
*symbiosis*, the PC and the phone working together.

```sh
pip install symbiolink
symdb connect --usb          # or: symdb connect 192.168.1.20
symdb shell info
symcast --usb                # mirror and control the phone
```

> **Full functionality needs a developer-unlocked phone.** The phone app asks for
> `SwEvent` (key control) and `CommDD` (USB cable), which a stock phone will
> not grant, so a stock phone refuses the install. Turn on **Open4All**
> (RomPatcher+) or use a developer certificate first:
> [unlock guide](https://manojanasuri16.github.io/RetroArchive/guides/unlock-n79/),
> [symbian-unlock-guide](https://github.com/manojanasuri16/symbian-unlock-guide).

Built for S60 3rd Edition (Symbian OS 9.1-9.3, FP1 and FP2). *Tested on: Nokia
N79 (FP2) and Nokia N82 (FP1), over Wi-Fi and USB.*

---

## Install

The package is on PyPI as [`symbiolink`](https://pypi.org/project/symbiolink/).
It needs Python 3.9+ on Linux and brings PyQt5 for `symcast`; `symdb` itself
uses only the standard library. The phone installer (`SymbioLink.sis`) and the
Linux USB rule ship inside the package.

| How | Command | Use it when |
|---|---|---|
| pip | `pip install symbiolink` | you have a virtual environment or `--user` install |
| pipx (recommended for the commands) | `pipx install symbiolink` | you want `symdb` / `symcast` on your PATH in their own environment |
| uv tool | `uv tool install symbiolink` | same, with uv |
| uv project | `uv add symbiolink` | you use SymbioLink from your own Python code (see *Python API*) |
| Latest from GitHub | `pipx install git+https://github.com/manojanasuri16/SymbioLink.git` | you want `master` before the next release |

Upgrade with `pipx upgrade symbiolink` (or `pip install -U symbiolink`,
`uv tool upgrade symbiolink`). Check with `symdb --version`.

<details>
<summary>Run from a clone (development)</summary>

```sh
git clone https://github.com/manojanasuri16/SymbioLink.git
cd SymbioLink
uv sync
uv run symdb --version
uv run symcast --fake        # a simulated phone, no hardware needed
```
</details>

## First run

1. **Unlock the phone for development** (Open4All on), see the box above.
2. **Put the SymbioLink app on the phone.** It is **one file** that already
   contains the Python for S60 1.4.5 runtime, so there is nothing else to
   install. The package carries it:
   ```sh
   symdb sis-path        # prints where SymbioLink.sis is
   ```
   Copy it to the memory card (mass storage mode or a card reader) or send it
   over Bluetooth, and open it in **Files** on the phone. The installer adds
   Python for S60 too, or skips it when the phone already has it. If Python for
   S60 is already installed, pick the **same drive** for SymbioLink. Later
   updates can go over the link itself:
   `symdb install-app`, then open **Files > Phone memory > SymbioLink.sis**.
3. **USB cable only, once per PC (Linux):**
   ```sh
   symdb setup-udev --install   # shows the rule, asks, then installs it
   ```
4. **Open SymbioLink on the phone** and leave it running (press End to go to
   the home screen; it keeps running). Then:
   ```sh
   symcast --usb              # phone in PC Suite mode, over the cable
   symcast 192.168.1.20       # or over Wi-Fi (the IP is on the app screen)
   symcast --discover         # or let it find the phone on the LAN
   ```

## adb commands and their symdb equivalents

Connect once (`symdb connect ...`) and the phone is remembered; `-s DEVICE`
picks one per command (`-s 192.168.1.20`, `-s usb`, `-s usb:/dev/ttyACM1`).

The 0.5.0 rows (install, uninstall, pm list, start, ps, kill, logcat, reboot,
wait-for-device, bootstart) **need a developer-unlocked (Open4All) phone**: since 0.5.0 the
SIS asks for the system capabilities TrustedUI and PowerMgmt (plus SwEvent), so
it no longer installs on a stock phone. They are implemented and tested
against the fake phone; hardware test pending (docs/CHECKLIST.md).

| adb (Android) | symdb (Symbian) | Notes |
|---|---|---|
| `adb devices` | `symdb devices --discover` | phones announcing on the LAN (UDP 47021) |
| `adb connect 192.168.1.20` | `symdb connect 192.168.1.20` | Wi-Fi, TCP 47020 |
| *(adb over USB)* | `symdb connect --usb` | PC Suite mode; auto-detects `/dev/ttyACM*` |
| `adb disconnect` | `symdb disconnect` | forget the remembered phone |
| `adb push photo.jpg /sdcard/` | `symdb push photo.jpg 'E:\Images\'` | Symbian paths: `C:` phone memory, `E:` memory card |
| `adb pull /sdcard/file.txt .` | `symdb pull 'E:\file.txt' .` | |
| `adb shell ls /sdcard` | `symdb shell ls 'E:\'` | |
| `adb shell mkdir ...` | `symdb shell mkdir 'E:\Others\new'` | |
| `adb shell rm ...` | `symdb shell rm 'E:\Others\old.txt'` | files or empty folders |
| `adb shell getprop` / `dumpsys` | `symdb shell info` | model, firmware, screen, memory, native module |
| `adb shell dumpsys battery` | `symdb shell battery` | |
| `adb shell input keyevent KEYCODE_MENU` | `symdb input key menu` | keys: `up down left right select lsk rsk call end menu clear 0-9 star hash` |
| `adb shell input text "hello"` | `symdb input text hello` | |
| `adb exec-out screencap -p > s.png` | `symdb screencap s.jpg` | JPEG, full 240x320 |
| `adb install app.apk` | `symdb install app.sis [--drive C\|E]` | silent (`RSWInstSilentLauncher`): pushes to `C:\Data\symdb_install.sis`, installs, deletes the copy. Installing SymbioLink itself hands over to `symbiolink_updater.exe` and waits for the new version (see *Self-update*). **Needs a developer-unlocked phone** (TrustedUI) |
| `adb uninstall pkg` | `symdb uninstall 0x2000ABCD` | silent, by package UID. **Needs a developer-unlocked phone** |
| `adb shell pm list packages` | `symdb shell pm list [FILTER]` | UID, caption, exe path (`RApaLsSession`) |
| `adb shell am start -n ...` | `symdb shell start <uid\|name>` (or `shell am start`) | `RApaLsSession::StartApp` |
| `adb shell ps` | `symdb shell ps` | SID, priority, state, full process name (`*` = SymbioLink) |
| `adb shell kill` / `am force-stop` | `symdb shell kill <uid\|name\|exe\|caption> [--force]` | `RProcess::Kill` (name matches the process, the exe file name such as `Calcsoft.exe` or the app caption); refuses SymbioLink itself and core system processes unless `--force`. **Needs a developer-unlocked phone** (PowerMgmt) |
| `adb logcat` | `symdb logcat PATH [-f] [--from-start]`, `symdb logcat --list` | tails any log file (0.5 s poll); `--list` shows `*_log.txt` on `E:\` and `C:\Data` |
| `adb reboot` | `symdb reboot` | reports "not available": the public SDKs have no restart API (see docs/PROTOCOL.md) |
| `adb wait-for-device` | `symdb wait-for-device [--timeout 120]` | retries USB, the last device, remembered Wi-Fi addresses and discovery |
| *(none)* | `symdb bootstart on\|off` | SymbioLink start at boot (also on the phone menu) |
| *(push the installer only)* | `symdb install-app` | pushes the bundled SymbioLink.sis for a manual install |
| `adb version` | `symdb --version` | |
| - | `symdb caps` | what this phone can and cannot do |
| - | `symdb sis-path`, `symdb setup-udev` | setup helpers |

## scrcpy and symcast

| scrcpy | symcast | Notes |
|---|---|---|
| `scrcpy` | `symcast --usb` / `symcast 192.168.1.20` | about 8-10 fps (the phone's JPEG encoding is the limit) |
| `scrcpy --record file.mp4` | `symcast ... --record file.avi` | MJPEG AVI via ffmpeg |
| mouse and keyboard | keyboard + clickable keypad | the phones have no touchscreen |
| `scrcpy --max-size` | `symcast --scale 2` | window scale |

Keys in the symcast window: arrows = d-pad, Enter/Space = select, F1 / F2 =
left / right softkey (Esc = right softkey), F3 = call, F4 = end, F5 = menu,
Backspace/Delete = clear, 0-9 * # direct, Ctrl+T = type text, Ctrl+S =
screenshot to ~/Pictures, Ctrl+R = reconnect, H or ? = help overlay.

## Python API

`uv add symbiolink` (or `pip install symbiolink`) and script the phone:

```python
from symbiolink import connect

phone = connect("usb", 47020)            # or connect("192.168.1.20", 47020)
print(phone.info()["model"], phone.battery())

phone.write_file("E:\\Others\\notes.txt", data=b"hello from the PC")
print(phone.read_file("E:\\Others\\notes.txt"))
for entry in phone.ls("E:\\Others\\")["entries"]:
    print(entry["name"], entry["size"])

meta, jpeg = phone.screencap()
open("screen.jpg", "wb").write(jpeg)

phone.request("input.key", key="menu")   # press a key
phone.request("input.text", text="hi")   # type text
phone.close()
```

The wire protocol (SL/1) is documented in
[protocol/slproto.md](protocol/slproto.md) and [docs/PROTOCOL.md](docs/PROTOCOL.md).

> **Status: 0.5.1.** Wi-Fi and USB verified on real phones (connect, device
> info, file transfer, live mirror, every key). 0.5.0 adds silent install /
> uninstall, app list / start, process list / kill, logcat, start at boot and
> wait-for-device (verified on the N82 except self-update; 0.5.1 adds
> `symbiolink_updater.exe` for self-update, which failed on the N82; fixed in
> 0.5.2, hardware test pending). Remaining limits (about
> 10 fps, no reboot API, one client at a time, no authentication) are listed below and in [docs/CHECKLIST.md](docs/CHECKLIST.md).

## What works today

| Area | State | Notes |
|---|---|---|
| SL/1 protocol (PC + phone + tests) | **working** | 37 offline tests pass (14 PC-side, 23 phone-side) |
| Device server (PyS60 1.4.5) | **working** | Wi-Fi and USB; one client at a time |
| `_symbiolink.pyd` (native screen capture, HAL facts, capability list, key injection), UID `0xE7A3D5F7` | **working** | keys and stream verified on the phone |
| `symbiolink_usb.exe` USB relay (phone side), UID `0xE7A3D5F8` | **working** | CDC-ACM port to the server, PC Suite mode |
| USB transport (PC side, `--usb`) | **working** | needs the udev rule; ~0.65 s to auto-detect |
| Wi-Fi TCP transport | **working** | 47020/TCP; the pattern RetroSend uses on this phone |
| Connect, hello, caps, info, battery | **working** | over Wi-Fi and USB |
| File push, pull, ls, mkdir, rm | **working** | 100 KB round trip byte-identical; a SIS pushed over the bridge installed |
| Live screen stream (`screen.stream`) and `symcast` mirror | **working** | ~8.8 fps over USB, ~7.4 fps over Wi-Fi at quality 50 (cap about 10 fps) |
| Key and text input (`input.key`, `input.text`) | **working** | keyboard and clickable keypad in `symcast`; needs Open4All (see Requirements) |
| `symcast` screenshot (Ctrl+S), help overlay, reconnect (Ctrl+R) | **working** | |
| UDP discovery | **implemented** | phone broadcasts, PC reads the source address |
| `symcast --record` (MJPEG AVI via ffmpeg) | **implemented, not yet run on a phone** | |
| Touch injection | **blocked** | needs a touchscreen device (S60 5th Edition / Symbian^3) |
| App list, process list, SIS install from the bridge | **blocked** | needs native helpers (`RApaLsSession`, `TFindProcess`); the install UI is the only route |

## Requirements in detail

**Phone**

- An S60 3rd Edition phone (FP1 or FP2; see *Tested on* above) for the reference path
  (FP1 and 5th Edition need their own platform adapter - see
  [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md#platforms)). Verified on firmware
  10.045 (RM-348).
- **Python for S60 1.4.5**: bundled. `SymbioLink.sis` embeds Nokia's
  `PythonForS60_1_4_5_3rdEd.sis` unchanged; the installer skips it when that
  version is already on the phone. The script shell is not needed.
- Wi-Fi, for the Wi-Fi transport. The phone picks the access point when the
  server binds its socket. The USB transport does not need Wi-Fi.
- For USB: the phone's connection mode set to **PC Suite**.
- Install SymbioLink on **the same drive as Python for S60** (phone memory,
  C:, is recommended; start at boot also needs C:). Installing on a different
  drive is experimental: a helper (`symbiolink_rscfix.exe`) runs during the
  install to make it work, but this is not yet confirmed on a phone.
- **A developer-unlocked phone: Open4All (or a developer certificate) active when you
  install.** The package asks for `SwEvent` (key input) and `CommDD` (USB
  relay), system capabilities a stock phone refuses, so on a stock phone
  the whole install is refused. See the box at the top for the unlock guide.

| Works on | Developer-unlocked S60v3 phone (Open4All) | Stock phone |
|---|---|---|
| Install SymbioLink | yes | no (installer refuses) |
| Wi-Fi: mirror, screenshots, files, info | yes | - |
| Key and text input | yes | - |
| USB cable | yes | - |

**PC**

- Linux with Python 3.9+. `pipx install symbiolink` brings PyQt5 (for
  `symcast`) along; `symdb` itself uses only the standard library.
- For USB: the udev rule installed (`symdb setup-udev --install`, see First run).
  Without it the phone's second serial port does not appear and `--usb` finds
  nothing.
- Only to rebuild the phone package yourself: the Symbian toolchain
  [symbian-s60v3-toolchain](https://github.com/manojanasuri16/symbian-s60v3-toolchain)
  (GnuPoc + CodeSourcery GCCE 3.4.3 + S60 3.2 SDK) and Python 2.7 for ensymble.
  The PC package already ships a built `SymbioLink.sis`.

## Details

### Ports and devices

`-s host[:port]` selects a device explicitly, `-s usb` or `--usb` the cable;
`SYMDB_DEVICE` does the same from the environment. Ports: **47020/TCP** (server,
also the local end of the USB relay), **47021/UDP** (announcements).

The TCP port can be changed in the app (**Options → Port**, used after a
restart). The phone announces it, so `symdb devices` still finds the phone;
without discovery use `symdb connect <phone-ip>:<port>`. The USB cable follows
the setting by itself. Most people should keep 47020.

### Wi-Fi network

SymbioLink asks once which Wi-Fi network to use and remembers it, so later
starts (including after updates and at boot) connect without asking. To switch:
**Options → Wi-Fi network** in the app, or from the PC `symdb wifi` (list),
`symdb wifi "<name>"` or `symdb wifi <id>` (switch), `symdb wifi --clear`
(ask again next start). In the Offline profile the phone still asks whether to
allow Wi-Fi; that question comes from the phone itself, not from SymbioLink.

### The USB rule

`symdb setup-udev --install` copies the bundled `70-symbiolink.rules` to
`/etc/udev/rules.d/` and reloads udev. The rule does two things. The phone's
second CDC-ACM port (the one `symbiolink_usb.exe` uses) declares a vendor protocol, so
Linux `cdc_acm` skips it; the rule adds the Nokia id so it appears as an extra
`/dev/ttyACMn`, normally `ttyACM1`. The logged-in user also gets access
(`uaccess`), so no `sudo` or `uucp` group is needed. The phone's own modem port
(`ttyACM0`) is held by the phone and reports `KErrAccessDenied`; it is not used.

### Try it without a phone (from a clone)

The fake phone implements the server side over a local directory, so the CLI and
the protocol can be exercised anywhere:

```sh
uv run python tests/fake_phone.py --root /tmp/phone --announce &
uv run symdb -s 127.0.0.1:47020 shell info
uv run symdb -s 127.0.0.1:47020 screencap /tmp/fake.jpg
uv run symcast --fake
```

## Building the phone package

The `SymbioLink.sis` bundled in the Python package is a build artifact of the
phone side. Rebuild it from a clone with:

```sh
sh scripts/build_native.sh    # -> phone/native/out/_symbiolink.pyd, symbiolink_usb.exe, symbiolink_updater.exe
sh scripts/build_sis.sh       # -> src/symbiolink/data/SymbioLink.sis
```

`build_native.sh` expects the toolchain next to this repository; point it
elsewhere with `SYMBIAN_SDK=/path/to/symbian-s60v3-toolchain`.
`build_sis.sh` looks for Python 2 and ensymble in the neighbouring RetroSend
checkout; override with `PY2=... ENSYMBLE=...`. The package carries
`_symbiolink.pyd` and `symbiolink_usb.exe`. It writes three files to
`src/symbiolink/data/` (all shipped in the wheel and attached to releases):

| File | Contents | Used for |
|---|---|---|
| `SymbioLink.sis` | app + embedded Python for S60 runtime + embedded updater | first installs (memory card, `symdb install-app`) |
| `SymbioLink-app.sis` | the app package `0xE7A3D601` alone | self-updates |
| `SymbioLink-updater.sis` | the updater package `0xE7A3D5F9` alone (`symbiolink_updater.exe`) | installed by `symdb install` before a self-update |

Bump `UPDATER_VERSION` in `build_sis.sh` only when the updater changes: the
installer skips an embedded package whose version is already installed.

### Self-update

A running PyS60 app cannot replace its own package (the installer answers
`KSWInstErrFileInUse`, -30477). `symdb install SymbioLink.sis` therefore:

0. never hands a bundle to the updater: when the SIS embeds other packages
   (the full `SymbioLink.sis`), it uses the sibling `SymbioLink-app.sis`, and
   refuses when there is none. If `SymbioLink-updater.sis` sits next to it (or
   in the installed package) it is installed first as an ordinary silent
   install (`already installed` / same version counts as ok; skip with
   `--skip-updater`);
1. pushes the app-only SIS and sends `pkg.install`; the phone answers
   `{"self": true, "detail": "handing over to the updater, reconnect in ~40 s"}`;
2. the app starts `symbiolink_updater.exe`, logs `exiting for update`, closes
   its sockets, calls `appuifw.app.set_exit()` and kills its own process;
3. the updater waits up to 30 s for the app and `symbiolink_usb.exe` to exit
   (kills them after that), refuses a SIS that contains its own package
   `0xE7A3D5F9`, installs silently with kill-app not allowed, logs the result to
   `E:\symbiolink_updater_log.txt` (or `C:\Data\`) and starts SymbioLink again;
4. `symdb` waits up to 150 s (`--wait-timeout`) for a server with a new
   version and prints `updated: old -> new`, or fails and points at the
   updater log (`symdb logcat E:\symbiolink_updater_log.txt`).

The updater is not part of the SymbioLink package, so it is never replaced
while it runs. 0.5.1 got this wrong: it handed the full bundle to the
updater, the bundle embeds the updater package, and with kill-app allowed the
installer closed the running updater (the install's own client), so the
install aborted after `installing to C:` and the phone stayed on 0.5.1. The
app also had not exited 30 s after the handover. Fixed in 0.5.2 (app-only
SIS, updater installed separately first, kill-app off, the app kills itself).
This works against a phone still on 0.5.1: the 0.5.1 updater then receives an
app-only SIS, so its kill-app option only touches the app, which is gone. Per-frame trace lines in the phone log appear only when
`C:\Data\symbiolink_debug.txt` exists at app start.

Commit the rebuilt
`src/symbiolink/data/SymbioLink.sis`, `SymbioLink-app.sis` and
`SymbioLink-updater.sis` (they are excepted from the `*.sis` ignore rule); `dist/` is only for `uv build` output.

## Tests

```sh
uv run pytest                        # framing, client, CLI, viewer (PC side)
python2 tests/test_phone_server.py   # device modules on Python 2.7
sh scripts/check_py22.sh             # rejects syntax newer than Python 2.2
sh scripts/build_native.sh           # native module compiles (arm-none-symbianelf-gcc)
sh scripts/build_sis.sh              # package builds
```

`tests/test_proto.py` and `tests/test_symcast.py` also run on their own with
`python3` (the viewer test needs PyQt5 and uses `QT_QPA_PLATFORM=offscreen`).
CI runs the pytest suite; the Python 2.7 phone test runs locally only, as
GitHub's setup-python no longer provides 2.7.

The phone-side checks above run offline. The hardware results in this README were
observed by hand on the phone, not by these tests.

## How it fits together

```
 PC (Python 3)                          Phone (PyS60 1.4.5 + native helpers)
 ┌──────────────┐   TCP 47020 / SL/1   ┌────────────────────────────────┐
 │ symdb       │ ───────────────────► │ linkserver.py  (app + sockets)   │
 │ symcast    │ ◄─────────────────── │ handlers.py  (commands)        │
 │ (PyQt5)      │   UDP 47021 announce │ s60v3.py     (platform)        │
 └──────────────┘                      │ n79.py       (hardware profile)│
        ▲                              │ _symbiolink.pyd (WS/HAL, native) │
        │ USB CDC-ACM (SL/1 bytes)     └──────────────▲─────────────────┘
        └────────────── cable ─────────── symbiolink_usb.exe ───┘ relays ACM::1 <-> 127.0.0.1:47020
```

- **Capability-driven.** Every command the phone cannot do comes back as a
  refusal with a reason, never as a silent failure. `symdb caps` prints the
  whole table.
- **Transport-independent protocol.** The same SL/1 byte stream runs over Wi-Fi
  TCP and over the USB cable (through the phone-side `symbiolink_usb.exe` relay). Nothing
  above the transport layer knows which one is in use.
- **Native where Python cannot reach.** PyS60 can screenshot and move files but
  cannot inject keys, list apps or report capabilities. Those go into native
  modules, behind the same protocol.

Detail: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md),
[docs/FEASIBILITY.md](docs/FEASIBILITY.md),
[protocol/slproto.md](protocol/slproto.md),
[docs/PROTOCOL.md](docs/PROTOCOL.md) (command meanings).

## Verified on hardware (0.3.5)

Nokia N79, firmware 10.045 (RM-348), 2026-11-29, server 0.3.5. Full evidence per
item is in [docs/CHECKLIST.md](docs/CHECKLIST.md).

- Connect, hello, caps, info and battery over Wi-Fi (TCP 47020) and over USB.
- Stream: q50 at 8.8 fps over USB and 7.4 fps over Wi-Fi (q30: 9.0 and 8.9),
  frames of about 14-18 KB. The limit is the phone's JPEG encode, about 80 ms per
  frame.
- Transfer: push about 132 KB/s over USB and 124 KB/s over Wi-Fi; pull about
  257 KB/s and 222 KB/s. Request round trip median 54 ms over USB, 56 ms over
  Wi-Fi.
- Keys seen on the screen: d-pad, select, both softkeys, call, end, menu, 0-9,
  star, hash, clear, `input.text`. The keypad autolock blocks injected keys until
  the phone is unlocked (LSK then `*`).
- Switching between USB and Wi-Fi works: a new client replaces a stale one.

## Roadmap

| Phase | Content | State |
|---|---|---|
| 1 | Protocol, `symdb`, device server, native helper, packaging | done; verified on hardware (Wi-Fi and USB) |
| 2 | Live screen mirroring, `symcast` viewer, frame rate/latency measurement | done; measured on hardware (about 8-9 fps) |
| 3 | Remote control: key injection (`SwEvent`), key maps, touch profiles | keys done; touch blocked |
| 4 | App list/launch/stop, processes, logs, SIS install | implemented in 0.5.0 and verified on the N82 (developer-unlocked); self-update via the updater in 0.5.1 pending test; reboot not available |
| 5 | Polished `symdb` + `symcast`, reconnection | partly: Ctrl+R reconnect; the rest planned |
| 6 | Other Symbian devices and OS generations | planned |

## Limitations (read before filing a bug)

- **PyS60 1.4.5 only.** One Python runtime per S60 3rd Edition generation; S60
  5th Edition and Symbian^3 ship PyS60 2.x with a different socket API.
- **Frame rate is capped at about 10 fps** by the phone's JPEG encode.
- **One client at a time**, and the phone cannot tell who connected (PyS60 has
  no `getpeername`), hence the UDP announcement direction.
- **Keypad autolock** blocks injected keys until the phone is unlocked.
- **0.5.0 needs a developer-unlocked phone**: silent install (TrustedUI) and process kill
  (PowerMgmt) are system capabilities; a stock phone refuses the SIS.
- **No reboot**: the public S60 3rd SDKs have no restart API (`symdb reboot`
  says so). `symdb shell kill SysAp --force` may force a restart (untested:
  a dying system-critical process reboots the phone), but that is a crash, not an API.
- **Start at boot** works when SymbioLink is installed to `C:`.
- **Key injection needs `SwEvent`**, a system capability: a stock phone refuses
  a self-signed package that declares it. Use an Open4All phone or a developer
  certificate.
- **No TLS, no authentication.** The server accepts any connection on the local
  network or the cable. Use it on networks you trust, or keep Wi-Fi off when not
  needed.

## Related projects

- [symbian-s60v3-toolchain](https://github.com/manojanasuri16/symbian-s60v3-toolchain) - the toolchain used to build this.
- [RetroSend](https://github.com/manojanasuri16/RetroSend),
  [RetroTele](https://github.com/manojanasuri16/RetroTele) - sibling S60 apps whose
  socket, packaging and native-helper patterns this project reuses.
- RetroCamKey - the key-injection pattern (`SimulateRawEvent`) this project follows.
- [localsend-py22](https://github.com/manojanasuri16/localsend-py22) - the
  PyS60 network notes that shaped the server.

## Publishing

Releases go to PyPI and GitHub Releases from `.github/workflows/release.yml`
when a `v*` tag is pushed.

One-time setup on PyPI (trusted publisher, no API token): at
<https://pypi.org/manage/account/publishing/> add a pending publisher with
PyPI project `symbiolink`, owner `manojanasuri16`, repository `SymbioLink`,
workflow `release.yml`, environment `pypi`. Create the `pypi` environment in the
GitHub repository settings (Environments) as well.

Then, for each release:

1. Bump `__version__` in `src/symbiolink/__init__.py` (the package version is
   read from it).
2. Rebuild the phone package if the phone side changed
   (`sh scripts/build_sis.sh`) and commit it.
3. `git tag vX.Y.Z && git push origin vX.Y.Z`.

The workflow builds the sdist and wheel with `uv build`, creates the GitHub
Release with them plus `SymbioLink.sis`, and publishes to PyPI.

## Licence

MIT, see [LICENSE](LICENSE). The Python for S60 1.4.5 runtime bundled in
`SymbioLink.sis` is Nokia's, released as open source under the Apache License
2.0 (see [phone/vendor/README.md](phone/vendor/README.md)); it is included
unchanged. The S60 SDK and the Symbian toolchain keep their own licences and
are not redistributed here.
