php-adb/README.md
2026-12-03 21:18:19 -05:00

67 lines
2.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# php-adb
A small PHP web app for controlling Android TV / ADB devices on your LAN. It scans common home subnets, discovers devices with ADB access, and lets you send remote-style commands from a browser — connecting to devices only when you choose.
> **LAN only.** This tool is intended for trusted local networks (e.g. 192.168.1.x / 192.168.2.x). It is not hardened for exposure to the internet.
## Features
- Scan `192.168.1.1–254` and `192.168.2.1–254` for reachable ADB endpoints (port `5555`) and attempt to identify device names where possible.
- Device list UI with connect/disconnect controls (no automatic connections).
- Send common TV remote key events (navigation, home/back/menu/apps/settings/info, playback, volume).
- Send text input to the focused field on the device (best results with basic ASCII).
- Simple JSON API (`api.php`) used by the frontend.
- Notes page (`notes.php`) for local notes/data helpers (see repo files).
## Requirements
- PHP (run via a local web server / PHP built-in server is fine for LAN use)
- `adb` (Android Platform Tools) installed and available on the `PATH` of the machine running the PHP app
- Devices must allow ADB debugging / be discoverable on port `5555` as configured for your setup
- Web server/PHP process must be able to execute `adb` commands
## Running locally (example)
From the repo root:
```bash
php -S 0.0.0.0:8000
```
Then open `http://<your-lan-ip>:8000/` in a browser on the same network.
## Usage
1. Open the web UI and click **Scan Network** to discover devices.
2. Pick a device and use **Connect** only when you want to control it.
3. Use the remote buttons or send text commands.
## Project layout (high level)
- `index.php` — main UI
- `api.php` — JSON API for scanning/ADB actions
- `lib/adb.php` — ADB helpers
- `assets/` — CSS/JS
- `data/` — local data storage (if used)
- `notes.php` — notes-related page
- `Agents.md` — notes for agents/contributors (historical context)
## Git remote
This repo is commonly pushed to:
```text
https://git.claytonia.net/Clarth/php-adb.git
```
(If your remote differs, update with `git remote set-url origin ...`.)
## Security notes
- Do **not** expose this app to the public internet.
- Anyone with access to the UI can attempt to control discovered devices on the LAN.
- Keep `adb` and device debugging settings appropriate for your environment.
## License
No license file is currently specified in this repository. Add a `LICENSE` if you want to clarify reuse terms.