One-click Android screen mirroring & control β powered by scrcpy
MirrorPy is a lightweight desktop GUI for scrcpy that makes mirroring your Android phone to your PC effortless. It features automatic device discovery via ADB mDNS, QR code pairing, and a one-click Quick Mirror button β no command line needed.
| Feature | Description |
|---|---|
| π Smart Auto-Detect | Discovers Android devices via ADB mDNS β no manual IP entry needed |
| β‘ Quick Mirror | One button: detect β connect β mirror in seconds |
| π· QR Code | Live QR code encodes adb connect string for easy sharing |
| π¨ Modern UI | Clean ttkbootstrap interface with dark/light themes |
| π± Device Card | Shows phone model, IP, and connection status at a glance |
| π Network Scan | Ping sweep to find devices on your subnet |
| π USB & Wi-Fi | Supports both USB debugging and wireless ADB over Wi-Fi |
| π‘οΈ Thread-Safe | All background operations are marshalled to the UI thread |
| π ADB Devices | Dropdown list with one-click device selection |
| πΎ Persistent Config | Settings saved automatically between sessions |
- Windows 10/11 (tested), Linux/macOS (experimental)
- Python 3.8+ (download)
- Android device with Developer Options enabled
- ADB & scrcpy binaries (included in this repo)
git clone https://github.com/Rfannn/mirrorpy.git
cd mirrorpy
pip install -r requirements.txtpython mirror.pyOr double-click mirror.bat if using the embedded Python distribution.
- Enable Developer Options on your Android phone
- Enable USB Debugging or Wireless Debugging
- Click β‘ Quick Mirror β that's it!
MirrorPy will automatically:
- Discover your device via ADB mDNS
- Connect to it
- Launch scrcpy for screen mirroring
- Click π Detect Device to find your phone
- Or enter the IP:port manually
- Click π Connect, then βΆ Mirror
If your phone requires pairing (Android 11+):
- Go to Settings β Developer Options β Wireless Debugging β Pair device
- Enter the Pair Port and Pairing Code in MirrorPy
- Click π€ Pair
mirrorpy/
βββ mirror.py # Main application (GUI + logic)
βββ test_mirror.py # Unit tests (38 tests)
βββ requirements.txt # Python dependencies
βββ settings.ini # User configuration (gitignored)
βββ .gitignore
βββ adb.exe # ADB binary (included)
βββ scrcpy.exe # scrcpy binary (included)
βββ python/ # Embedded Python (optional)
βββ .github/
βββ workflows/
βββ ci.yml # CI: lint + test
βββ release.yml # Release automation
| Component | Purpose |
|---|---|
full_discover() |
Combined ADB devices + mDNS discovery |
adb_mdns_discover() |
Discover devices via adb mdns services |
generate_qr_pil() |
Generate QR codes for connection strings |
ScrcpyLauncher |
Main GUI application class |
DeviceCard |
Widget showing detected device info |
GuiLogger |
Thread-safe scrolling log widget |
# Run all tests
python -m unittest test_mirror -v
# Run specific test class
python -m unittest test_mirror.TestFullDiscover -vTests cover:
- Helper functions (get_local_ip, ping_host, run_cmd)
- ADB device parsing and mDNS discovery
- QR code generation
- Auto-detect returns phone IP (not laptop IP)
- Config save/load
- Thread safety
MirrorPy uses GitHub Actions for continuous integration and automated releases:
- Linting: flake8 for code quality
- Security: bandit for vulnerability scanning
- Testing: Unit tests on Windows and Linux
- Python versions: 3.9, 3.10, 3.11, 3.12
- Trigger: Push a tag (e.g.,
v2.1.0) - Builds: Windows
.exeand Linux.AppImage - Release notes: Auto-generated from commits
- Artifacts: Uploaded to GitHub Releases
# Tag the release
git tag v2.1.0
# Push the tag to trigger the release workflow
git push origin v2.1.0The release workflow will:
- Build executables for Windows and Linux
- Create a GitHub Release with auto-generated notes
- Upload the executables as release assets
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
git clone https://github.com/Rfannn/mirrorpy.git
cd mirrorpy
pip install -r requirements.txt
python -m unittest test_mirror -v- Python 3.8+
- Follow existing conventions
- Add tests for new features
- Keep commits atomic and well-described
See CHANGELOG.md for a detailed history of changes.
- β‘ Quick Mirror β one-click detect β connect β mirror
- π Smart Auto-Detect β uses ADB mDNS to find real Android devices
- π· QR Code β live QR code for connection strings
- π¨ Redesigned UI β device card, connection wizard, status indicators
- π‘οΈ Thread Safety β all tkinter updates marshalled to main thread
- π§ͺ 38 unit tests β comprehensive test coverage
- Initial release
- Basic scrcpy launcher with USB/Wi-Fi support
- ttkbootstrap GUI
- Network subnet scan
| Problem | Solution |
|---|---|
Python not found |
Install Python 3.8+ and add to PATH |
No module named ttkbootstrap |
Run pip install ttkbootstrap |
scrcpy not found |
Ensure scrcpy.exe is in the project folder or on PATH |
ADB device not found |
Enable USB/Wireless Debugging; same Wi-Fi network |
| Auto-detect finds nothing | Check ADB server: run adb start-server manually |
| QR code not updating | Re-detect the device to refresh IP/port |
This project is licensed under the Apache License 2.0 β see LICENSE for details.
- scrcpy by Genymobile β the mirroring engine
- ttkbootstrap β modern tkinter themes
- qrcode β QR code generation
Made with β€οΈ by Rfannn