Scrcpy
pronounced "screen copy"
This application mirrors Android devices (video and audio) connected via USB or over TCP/IP, and allows to control the device with the keyboard and the mouse of the computer. It does not require any root access. It works on Linux, Windows and macOS.
Tutorial for ADB over TCP/IP, here.
Just type this command for default mode:
scrcpy
For docs, here.
This script is using for auto connect, make sure your ADB is already connected to your PC using pair code.
adb pair ip:port pairing-code
Notes: This is modification code from scrcpy-noconsole.vbs
CreateObject("Wscript.Shell").Run "adb connect ip:port", 0, true
strCommand = "cmd /c scrcpy.exe"
For Each Arg In WScript.Arguments
strCommand = strCommand & " """ & replace(Arg, """", """""""""") & """"
Next
CreateObject("Wscript.Shell").Run strCommand, 0, false
IP and port sometimes changes if you reconnect wireless connection. Make sure to change this everytime it changes.
Troubleshoot:
Mouse and keyboard do not work
On some devices, you may need to enable an option to allow simulating input. In developer options, enable:
USB debugging (Security settings) Allow granting permissions and simulating input via USB debugging
Rebooting the device is necessary once this option is set.
Useful daily commands
Create virtual display:
// Always on top and using H265
scrcpy --new-display=2340x1080 --video-codec=h265 --always-on-top
Running APKs on virtual display:
scrcpy --new-display=1920x1080 --start-app=<package_apk_name>
// Example running Genshin Impact on virtual display
scrcpy --new-display=1920x1080 --start-app=com.miHoYo.GenshinImpact
Running input only (no audio and video)
scrcpy --no-video --no-audio -M
Last updated