Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ScreenShare Pro: Android Mirroring and Remote Control

ScreenShare Pro is a system that allows you to view your Android phone's screen live on your laptop and control it using your computer's mouse. This project consists of an Android application that captures and encodes the screen and a Python-based laptop client that displays the video and handles mouse input.

System Requirements

  1. Hardware:
    • An Android phone running Android 10 or higher.
    • A Windows laptop.
    • A high-quality USB data cable.
  2. Software:
    • Python 3.x installed on the laptop.
    • FFmpeg installed and added to the system PATH.
    • Android Studio (to install the app on the phone).

Step 1: Phone Configuration

Before the system can connect, you must enable specific developer permissions on your Android device.

  1. Enable Developer Mode:
    • Open Settings on your phone.
    • Navigate to About Device or About Phone.
    • Find the Build Number and tap it 7 times until a message appears saying Developer mode is on.
  2. Enable Debugging Settings:
    • Go back to Settings > Additional Settings > Developer Options.
    • Turn ON USB Debugging.
    • Turn ON Disable Permission Monitoring (found at the bottom of the list).
    • Turn ON USB Debugging (Security Settings). This is required to allow the laptop to simulate touches.

Step 2: Laptop Configuration

1. Install Python Libraries

Open your Command Prompt or PowerShell and run the following command to install the necessary image processing libraries:

pip install opencv-python numpy

2. Install FFmpeg

The laptop client uses FFmpeg to process the live video stream.

  • Download the FFmpeg essentials build from a trusted source (such as gyan.dev).
  • Extract the folder.
  • Add the bin folder inside the extracted files to your Windows System Environment Variables (PATH).

Step 3: Installation and Setup

1. Install the Android App

  • Open the android-app folder in Android Studio.
  • Connect your phone via USB.
  • Click the Run button (green triangle) to install the app on your phone.
  • Once installed, open the app on your phone.
  • Tap Enable Accessibility for Remote Control. Find ScreenShare in the list and switch it to ON.
  • Tap Start Screen Share. Accept the system permission prompt by clicking Start Now.

2. Create the Connection Bridge

Open a terminal on your laptop and run the following commands to allow the laptop to talk to the phone over USB:

adb forward tcp:8080 tcp:8080 adb forward tcp:8081 tcp:8081

Step 4: Running the Remote Control

  1. Open a terminal in the laptop-client folder.
  2. Run the control script using the following command:

python live_control.py 127.0.0.1

  1. A window will appear showing your phone screen.

How to Control:

  • Left Click: Performs a tap on the phone.
  • Click and Drag: Performs a swipe on the phone.
  • Q Key: Press the Q key on your keyboard to close the window.

Troubleshooting

  • Problem: The window opens but stays black or frozen.
    • Solution: Ensure you have tapped Start Screen Share on the phone and granted permission. Move the phone screen (swipe) to trigger the first video frame.
  • Problem: Clicks do not work on the phone.
    • Solution: Ensure that both Accessibility Service and USB Debugging (Security Settings) are enabled in the phone settings.
  • Problem: Python is not recognized.
    • Solution: Re-install Python and ensure you check the box that says Add Python to PATH during installation.

Technical Summary

  • Video Stream: Raw H.264 byte stream at 2 Mbps.
  • Port 8080: Used for sending touch and gesture commands.
  • Port 8081: Used for receiving the video stream.
  • Coordinate Mapping: Scales laptop window coordinates to the phone's physical resolution of 1080x2400.

About

ScreenShare Pro is a system that allows you to view your Android phone's screen live on your laptop and control it using your computer's mouse.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages