At first, the information on the Internet was
sudo apt-get instll scrcpy
After the installation on ubuntu is complete, connect the mobile phone, run scrcpy, and it will always display
$ scrcpy -m 400
INFO: scrcpy 1.12.1 <https://github.com/Genymobile/scrcpy>
/usr/share/scrcpy/scrcpy-server: 1 fil...ed. 102.4 MB/s (24773 bytes in 0.000s)
INFO: Initial texture: 224x400
WARN: Device disconnected
After that, it was stated in an article that the version 12 of ANDROID requires a scrcpy version above 1.18, but the current version is 1.12
当sudo apt-get remove scrcpy
sudo apt-get install scrcpy=1.18
The specified version numbers failed to install normally, and then the installation was successful with snap
$ snap install scrcpy
scrcpy v1.24 from sisco311 installed
Successfully installed the latest version
When executing scrcpy, the program cannot be found, check
$ scrcpy
bash: /usr/bin/scrcpy: No such file or directory
$ whereis scrcpy
scrcpy: /usr/share/scrcpy /snap/bin/scrcpy.adb /snap/bin/scrcpy
$/snap/bin/scrcpy
run successfully