无线投屏手机(安卓)屏幕到 Linux(ubuntu 22.04)桌面

1.安装 scrcpy

安装 scrcpy会自动安装 adb. 这个版本的adb功能不是最全的,需要删掉,然后从链接

https://dl.google.com/android/repository/platform-tools-latest-darwin.zip

下载,解压安装即可。

2. 在手机上 打开开发者模式和  USB调试模式,并且允许无线调试,会看到下面一个界面:

点击 "pair device with pairing code", 会弹出来一个 IP/端口号和配对数字:

在终端运行:

./adb pair 192.168.1.130:373081

然后 adb连接手机:

./adb connect 192.168.1.130:37345

连接成功后,执行

scrcpy
scrcpy 1.21 <https://github.com/Genymobile/scrcpy>
/usr/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 261.0 MB/s (39473 bytes in 0.000s)
[server] INFO: Device: samsung SM-A5260 (Android 12)
INFO: Renderer: opengl
INFO: OpenGL version: 4.6.0 NVIDIA 530.41.03
INFO: Trilinear filtering enabled
INFO: Initial texture: 1080x2400

这样,不需要USB连接, 手机界面就投到 ubuntu上去了。

 参考:

How to install ADB on Windows, macOS, and Linux

猜你喜欢

转载自blog.csdn.net/CaspianSea/article/details/131882057