Skip to content

To control your phone from your desktop, I mixed and matched a bunch of stuff to get it working. enjoy!

Notifications You must be signed in to change notification settings

jtgsystems/Phone-Control-Project

Repository files navigation

Phone Control Project 2.0 πŸš€

Advanced Android device control with modern web interface, wireless connectivity, and comprehensive automation features.

✨ Features

πŸ”₯ New in v2.0

  • Modern Web Interface - Beautiful, responsive UI with real-time controls
  • Wireless ADB Connection - Connect devices over WiFi without USB cables
  • Cross-Platform Support - Works on Windows, macOS, and Linux
  • Advanced Automation - Batch operations, performance monitoring, and scripting
  • Electron Desktop App - Native desktop experience with system integration
  • Docker Support - Easy deployment with containerization
  • Python API - FastAPI backend with comprehensive device management
  • File Transfer - Drag-and-drop file transfers between device and computer
  • Screen Recording - Built-in screen recording with customizable settings

πŸ“± Core Features

  • Real-time device discovery and management
  • High-quality screen mirroring with scrcpy
  • Remote shell access and command execution
  • APK installation and management
  • Device backup and restore
  • Performance monitoring and optimization
  • Network speed testing
  • Automated app testing

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • Python 3.8+
  • Android device with USB debugging enabled

Installation

Option 1: Traditional Setup

# Clone the repository
git clone https://github.com/jtgsystems/Phone-Control-Project.git
cd Phone-Control-Project

# Install Node.js dependencies
npm install

# Install Python dependencies
pip install -r requirements.txt

# Start the application
npm start

Option 2: Docker Setup

# Clone and start with Docker
git clone https://github.com/jtgsystems/Phone-Control-Project.git
cd Phone-Control-Project

# Start all services
docker-compose up -d

# Access the web interface
open http://localhost:3000

Option 3: Electron Desktop App

# Install and start Electron app
npm install
npm run electron

πŸ“– Usage Guide

1. Connect Your Device

USB Connection

  1. Enable Developer Options on your Android device
  2. Enable USB Debugging in Developer Options
  3. Connect device via USB cable
  4. Authorize the connection when prompted

WiFi Connection

  1. First connect via USB to enable WiFi debugging
  2. Click "Enable WiFi" button for your device
  3. Note your device's IP address
  4. Click "WiFi Connect" and enter the IP address
  5. Disconnect USB cable - you're now wireless!

2. Screen Mirroring

  • Click "Start Mirror" to begin screen mirroring
  • Use keyboard shortcuts for common actions
  • Customize video quality in settings

3. File Transfer

  • Click "Transfer Files" to upload/download files
  • Drag and drop files directly onto the interface
  • Monitor transfer progress in real-time

4. Remote Shell

  • Click "ADB Shell" to open command interface
  • Execute any ADB command directly
  • View command history and output

πŸ”§ Advanced Features

Automation Scripts

// Example: Batch install APKs
const automation = new DeviceAutomation(deviceController);
const results = await automation.batchInstallApks(deviceId, [
    '/path/to/app1.apk',
    '/path/to/app2.apk'
]);

Performance Monitoring

// Monitor device performance for 60 seconds
const metrics = await automation.monitorPerformance(deviceId, 60000);
console.log('CPU Usage:', metrics.summary.cpu.avg);

Custom Automation

// Automated app testing
const testActions = [
    { type: 'tap', x: 500, y: 1000 },
    { type: 'swipe', x1: 300, y1: 800, x2: 300, y2: 400 },
    { type: 'text', text: 'Hello World' }
];
await automation.testApp(deviceId, 'com.example.app', testActions);

πŸ—οΈ Architecture

Phone-Control-Project/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ api/           # Python FastAPI backend
β”‚   β”œβ”€β”€ ui/            # Web interface (HTML/CSS/JS)
β”‚   β”œβ”€β”€ core/          # Core device management
β”‚   └── utils/         # Automation utilities
β”œβ”€β”€ Software/          # Bundled ADB and scrcpy
β”œβ”€β”€ electron-main.js   # Electron desktop app
└── docker-compose.yml # Docker deployment

πŸ”Œ API Endpoints

Device Management

  • GET /api/devices - List connected devices
  • POST /api/connect-wifi - Connect via WiFi
  • POST /api/enable-wifi/{device_id} - Enable WiFi debugging

Screen Control

  • POST /api/scrcpy/start - Start screen mirroring
  • POST /api/scrcpy/stop - Stop screen mirroring
  • POST /api/screenshot/{device_id} - Take screenshot

File Operations

  • POST /api/upload/{device_id} - Upload file to device
  • POST /api/download/{device_id} - Download from device

Automation

  • POST /api/shell-command - Execute shell command
  • POST /api/install-apk - Install APK file
  • POST /api/backup - Backup device data

βš™οΈ Configuration

Environment Variables

# Web Server
PORT=3000
NODE_ENV=production

# API Server
API_HOST=0.0.0.0
API_PORT=8000
PYTHONPATH=/app

# Database
REDIS_URL=redis://localhost:6379

Scrcpy Options

{
  "bitrate": "8M",
  "maxSize": "1080",
  "renderer": "opengl",
  "stayAwake": true,
  "showTouches": true
}

πŸš€ Performance Optimizations

  • Concurrent Operations - Multiple devices handled simultaneously
  • Efficient Streaming - Optimized video compression and transmission
  • Memory Management - Smart resource cleanup and monitoring
  • Network Optimization - Adaptive bitrate and connection pooling

πŸ”’ Security Features

  • Input validation and sanitization
  • Secure file upload handling
  • Process isolation and sandboxing
  • Authentication and authorization support
  • Certificate validation for HTTPS

πŸ“± Supported Platforms

  • Windows 10/11
  • macOS 10.15+
  • Linux Ubuntu 18.04+
  • Android 5.0+ (API level 21+)

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes and test thoroughly
  4. Commit changes: git commit -m 'Add feature description'
  5. Push to branch: git push origin feature-name
  6. Create a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Troubleshooting

Common Issues

Device not detected:

  • Ensure USB debugging is enabled
  • Try different USB cable/port
  • Install device drivers (Windows)

Connection timeout:

  • Check firewall settings
  • Verify IP address is correct
  • Ensure device and computer are on same network

Screen mirroring laggy:

  • Reduce video bitrate in settings
  • Lower maximum resolution
  • Check network bandwidth

Getting Help

🎯 Roadmap

  • iOS device support
  • Cloud deployment options
  • Machine learning automation
  • Plugin system for extensions
  • Multi-language support
  • Advanced scripting interface

Built with ❀️ by JTG Systems

Empowering developers with advanced Android device control

About

To control your phone from your desktop, I mixed and matched a bunch of stuff to get it working. enjoy!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •