Skip to content

Commit 213bacd

Browse files
committed
Implement initial version of the droidmgr application with core device management and UI components.
1 parent 9c7d44f commit 213bacd

23 files changed

Lines changed: 4574 additions & 2 deletions

.gitignore

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
bin/
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script, and contain the bin/
31+
# directory corresponding to the Python interpreter
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# PEP 582; used by e.g. github.com/pdm-project/pdm
86+
__pypackages__/
87+
88+
# Celery stuff
89+
celerybeat-schedule
90+
celerybeat.pid
91+
92+
# SageMath parsed files
93+
*.sage.py
94+
95+
# Environments
96+
.env
97+
.venv
98+
env/
99+
venv/
100+
ENV/
101+
env.bak/
102+
venv.bak/
103+
104+
# Spyder project settings
105+
.spyderproject
106+
.spyproject
107+
108+
# Rope project settings
109+
.ropeproject
110+
111+
# mkdocs documentation
112+
/site
113+
114+
# mypy
115+
.mypy_cache/
116+
.dmypy.json
117+
dmypy.json
118+
119+
# Pyre type checker
120+
.pyre/
121+
122+
# pytype static type analyzer
123+
.pytype/
124+
125+
# Cython debug symbols
126+
cython_debug/
127+
128+
# PyCharm
129+
.idea/
130+
131+
# Custom
132+
.agent

README.md

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,63 @@
1-
# droidcpy
2-
A GUI for scrcpy
1+
# droidmgr
2+
3+
A GUI frontend for scrcpy and device manager for Android written in Python using tkinter.
4+
5+
## Features
6+
7+
- **Device Management**: List and manage all connected Android devices
8+
- **Screen Mirroring**: Start/stop screen mirroring using scrcpy
9+
- **Process Management**: View and kill running processes on devices
10+
- **App Management**: List, start, and stop installed applications
11+
- **File Management**: Browse, download, upload, and delete files on devices
12+
- **Auto-Setup**: Automatically downloads and installs ADB if not found
13+
- **Native Theming**: Uses the native theming of your operating system
14+
15+
## Installation
16+
17+
### Prerequisites
18+
19+
The application uses only Python's standard library, but requires system dependencies:
20+
21+
1. **scrcpy** - For screen mirroring
22+
- Linux: `sudo apt install scrcpy`
23+
- macOS: `brew install scrcpy`
24+
- Windows: Download from [scrcpy releases](https://github.com/Genymobile/scrcpy/releases)
25+
26+
2. **ADB** - Will be downloaded automatically if not found
27+
28+
### Running
29+
30+
Simply execute the main entry point:
31+
32+
```bash
33+
python3 droidmgr.py
34+
```
35+
36+
Or make it executable:
37+
38+
```bash
39+
chmod +x droidmgr.py
40+
./droidmgr.py
41+
```
42+
43+
## Usage
44+
45+
1. **Connect your Android device** via USB or WiFi ADB
46+
2. **Enable USB debugging** in Developer Options on your device
47+
3. **Run droidmgr**: `python3 droidmgr.py`
48+
4. **Select a device** from the Devices tab
49+
5. **Use the tabs** to manage processes, apps, or files
50+
6. **Click "Start Mirroring"** to begin screen mirroring
51+
52+
## Development
53+
54+
The codebase is designed with clean separation:
55+
56+
- **Core modules** are UI-agnostic and can be used independently
57+
- **UI modules** only handle presentation and user interaction
58+
- **Threading** is used for long-running operations to keep UI responsive
59+
- **Error handling** provides user-friendly messages for common issues
60+
61+
## License
62+
63+
All the code in this repository are released under the Mozilla Public License 2.0. See [LICENSE](LICENSE) file for details.

droidmgr.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/usr/bin/env python3
2+
"""droidmgr - GUI frontend for scrcpy.
3+
4+
This is the main entry point for the application.
5+
It automatically initializes and starts the UI.
6+
"""
7+
8+
import sys
9+
from pathlib import Path
10+
11+
# Add src to path
12+
sys.path.insert(0, str(Path(__file__).parent / 'src'))
13+
14+
from ui import MainWindow, InitDialog
15+
16+
17+
def main():
18+
"""Main entry point for droidmgr."""
19+
print("Starting droidmgr...")
20+
print("Checking dependencies...")
21+
22+
# Try to get existing paths first
23+
from core import DependencyManager
24+
dep_manager = DependencyManager()
25+
26+
adb_path = None
27+
scrcpy_path = None
28+
show_dialog = False
29+
30+
try:
31+
adb_path = dep_manager.get_adb_path()
32+
print(f"✓ ADB found at: {adb_path}")
33+
except RuntimeError:
34+
print("✗ ADB not found")
35+
show_dialog = True
36+
37+
try:
38+
scrcpy_path = dep_manager.get_scrcpy_path()
39+
print(f"✓ scrcpy found at: {scrcpy_path}")
40+
except RuntimeError:
41+
print("✗ scrcpy not found")
42+
show_dialog = True
43+
44+
# Only show initialization dialog if dependencies are missing
45+
if show_dialog:
46+
print("Initializing missing dependencies...")
47+
init_dialog = InitDialog()
48+
success, adb_path, scrcpy_path = init_dialog.run()
49+
50+
if not success:
51+
print("Initialization cancelled or failed.")
52+
return
53+
54+
print("Starting UI...")
55+
app = MainWindow(adb_path, scrcpy_path)
56+
app.run()
57+
58+
59+
if __name__ == '__main__':
60+
main()

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Python standard library (built-in)
2+
tkinter # GUI framework (usually pre-installed with Python)

src/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""droidmgr - GUI frontend for scrcpy."""
2+
3+
__version__ = "0.1.0"

src/core/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""Core functionality for droidmgr."""
2+
3+
from .device_manager import DeviceManager
4+
from .adb_manager import ADBManager
5+
from .scrcpy_manager import ScrcpyManager
6+
from .dependency_manager import DependencyManager
7+
from .config_manager import ConfigManager
8+
9+
__all__ = ['DeviceManager', 'ADBManager', 'ScrcpyManager', 'DependencyManager', 'ConfigManager']

0 commit comments

Comments
 (0)