adb_screen is a Windows desktop tool for mirroring an Android device and sending input back over ADB. It uses Android Studio's screen-sharing-agent.jar for video/control transport, PyAV for decoding, and a PySide6 UI for interaction.
- Mirrors the Android screen in a desktop window.
- Sends click, drag, scroll, text input, and common key events back to the device.
- Supports rooted devices that require
sufor touch injection. - Automatically falls back to
adb shell inputif the screen-sharing agent cannot inject touch events on the target ROM. - Optionally enables USB reverse tethering through
gnirehtet.
The runtime-critical parts are:
main.pysrc/screen-sharing-agent/requirements.txtREADME.mdrun_adb_screen.cmd
Optional but useful:
tests/vendor/gnirehtet/if you want theUSB internetbutton to workadb/adb.exe,adb/AdbWinApi.dll, andadb/AdbWinUsbApi.dllif you want to bundle ADB inside the repo
Not required for adb_screen itself and safe to remove before uploading to Gitee:
vendor/linuxdeploy/vendor/termux/vendor/termux-browser/vendor/termux-widget/src/adb_screen.egg-info/src/__pycache__/- sample screenshots such as
termux_screen.png,xfce_touch_screen.png, and similar image files launcher4x6.db
- Windows 10 or newer
- Python 3.10+
- One Android device with USB debugging enabled
screen-sharing-agent.jarand its ABI libraries underscreen-sharing-agent/- A working
adb.exe, either:- bundled in
adb/, or - available in
PATH, or - installed under a common Android SDK
platform-toolspath
- bundled in
adb_screen/
README.md
main.py
requirements.txt
pytest.ini
run_adb_screen.cmd
adb/
adb.exe
AdbWinApi.dll
AdbWinUsbApi.dll
src/
adb.py
cli.py
protocol.py
reverse_tether.py
session.py
viewer.py
__init__.py
__main__.py
screen-sharing-agent/
screen-sharing-agent.jar
arm64-v8a/
armeabi-v7a/
x86/
x86_64/
tests/ # optional
vendor/
gnirehtet/ # optional, for USB internet only
Create a virtual environment inside the adb_screen directory and install the project in editable mode:
cd adb_screen
py -3 -m venv .venv
.\.venv\Scripts\python -m pip install --upgrade pip
.\.venv\Scripts\python -m pip install -r requirements.txtIf you do not use py, replace it with python.
Use the local launcher in this directory:
cd adb_screen
.\run_adb_screen.cmdThe launcher prefers adb_screen\.venv\Scripts\python.exe. If no local virtual environment exists, it falls back to py -3 and then python.
cd adb_screen
.\.venv\Scripts\python .\main.pyExamples:
.\.venv\Scripts\python .\main.py --serial e2bb5a16
.\.venv\Scripts\python .\main.py --use-root
.\.venv\Scripts\python .\main.py --adb "C:\Android\platform-tools\adb.exe"Useful arguments:
--adb <path>: explicitadb.exepath--serial <serial>: select one device when multiple devices are connected--codec avc|hevc|av1: choose the preferred video codec--use-root: run the agent throughsu--no-use-root: force a non-root session even if saved settings were root-enabled--resource-dir <path>: override the defaultscreen-sharing-agent/directory
- If only one device is connected, you can leave the serial field empty.
- If your ROM kills touch injection immediately, enable
Use root (su) for touch inputbefore connecting. - If the agent still cannot inject touch events, the app can reconnect with an
adb shell inputfallback backend. - The
Turn off displayoption keeps the phone panel dark while mirroring and restores it on disconnect.
The USB internet button is optional and depends on vendor/gnirehtet/release/gnirehtet-rust-win64/ containing:
gnirehtet.exegnirehtet.apk
When enabled, the desktop app installs the APK, starts the relay on Windows, and asks Android to route traffic through the USB-connected host. Some devices will show a VPN confirmation dialog that the user must accept.
If you do not need this feature, you can omit vendor/gnirehtet/ from the repo.
- Left click / drag: touch and swipe
- Mouse wheel: scroll
- Text keys: send text input
Backspace,Delete,Enter,Esc,Tab, and arrow keys: send Android key eventsBack,Home,Power, and task-switch buttons: send the matching Android key codes
cd adb_screen
.\.venv\Scripts\python -m pytestUnable to locate adb: putadb.exeinadb/, add it toPATH, or pass--adbexplicitly.Multiple devices are connected: fill the serial field or pass--serial.- Touch disconnects right after click: retry with
--use-rootor enable the root checkbox in the UI. USB internet failed: make surevendor/gnirehtetexists and accept the VPN prompt on the device.Missing agent jar: verifyscreen-sharing-agent/screen-sharing-agent.jarand ABI folders are present.