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

1.安装 scrcpy

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

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

下载,解压安装即可。

  1. 在手机上 打开开发者模式和 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

相关推荐
阿pin10 小时前
Android随笔-kotlin withContext
android·kotlin·withcontext
树码小子11 小时前
开启 IDEA 中的断言功能
android·java·intellij-idea
Kslient11 小时前
HeaderBehavior
android
造火箭12 小时前
嵌入式芯片 SRAM / PSRAM 与手机 DDR / eMMC 全面对比分析
智能手机
Android-Flutter12 小时前
android 动画详解
android·kotlin
poiu123465715 小时前
如何一键清理手机空间且不删除用户数据|工具客观实测对比
智能手机
小孔龙17 小时前
GraphicBuffer 跨进程共享
android
行业研究员18 小时前
Android内置GPS与腾讯地图定位技术对比分析
android·android定位·腾讯地图定位
Android-Flutter19 小时前
android WMS 详解(二)
android·kotlin
游戏开发爱好者819 小时前
App Store 上传 IPA 自动化,.p8 密钥认证与 CI/CD 接入实战
android·运维·ci/cd·小程序·uni-app·自动化·iphone