Android mobile phone screen projection to computer tutorial based on Scrcpy

Android mobile phone screen projection to computer tutorial based on Scrcpy

I. Introduction

When executing some projects, there is a need to obtain the screen of the mobile phone, so I sorted out the computer tutorials in this area.
After many comparisons, I chose Scrcpy, which has a better projection effect, as the software for mobile phone screen projection.

Two, specific steps

1. Software download

scrcpy official website Windows software download
here may need to climb over the wall, partners who do not have a ladder can download from my network disk.
Link: https://pan.baidu.com/s/1tyWuEfzrCvWj9mqvvRknpw?pwd=6hjx
Extraction code:
The page after unpacking the 6hjx software is as follows
insert image description here

2. Environment configuration

Enter environment in the search box, select Edit System Environment Variables
insert image description here
and select Environment Variables

insert image description here
Select Path and click Edit
insert image description here
insert image description here

Congratulations, your environment is configured here.

3. Scrcpy-based mobile screen projection tutorial

1. Scrcpy-based wired mobile screen projection

Find [Developer Options] in the settings of the mobile phone and set it to allow USB debugging. Since the wireless projection will be demonstrated later, the wireless debugging is simply allowed. If you only need wired projection, then only enable USB debugging.
insert image description here
Win+R to open and run, enter cmd and enter
insert image description here

adb devices
scrcpy

insert image description here
insert image description here
Congratulations, you have successfully run it here.

2. Wireless projection

Scrcpy uses adb to communicate with Android devices, and adb itself supports wireless connections. So in addition to the USB data cable, we can also use it wirelessly. The premise is to ensure that the mobile phone and the computer are in the same LAN (connected to the same WiFi router), the steps are as follows:

  • 1) Query the current IP address of the device;
  • 2) Enable the TCP/IP connection of adb, execute the command: adb tcpip 5555 , where 5555 is the port number;
  • 3) Unplug the data cable;
  • 4) To connect via WiFi, execute the command:
    scrcpy --tcpip=192.168.1.108 -w -m 1024
  • 5) If the WiFi is slow, you can adjust the code rate:
    scrcpy --tcpip=192.168.1.108 -w -b 3M -m 800
    means limit 3 Mbps, screen resolution limit 800, the value can be adjusted freely;
  • To switch back to USB mode, execute the command: adb usb

Guess you like

Origin blog.csdn.net/qq_51116518/article/details/131427363