本文以ArchLinux为例
手机控制 Scrcpy
安装 Scrcpy
$ sudo pacman -S scrcpy
#pacman会安装依赖包 android-tools
#其他发行版如果没有请自行安装
查看设备ID
首先用数据线连接上你的电脑和手机,在终端输入 adb devices
查看设备ID,其中 4dcb9ad5 为设备ID
$ adb devices
* daemon not running; starting now at tcp:5037
* daemon started successfully
List of devices attached
4dcb9ad5 no permissions; see [http://developer.android.com/tools/device.html]
连接控制手机
$ sudo -b scrcpy -s 4dcb9ad5 --turn-screen-off
## 在后台并让手机保持熄屏运行
--turn-screen-off
让手机保持熄屏状态
如果不出意外,你的电脑应该可以直接显示和控制你的手机,但是这样手机就没法离电脑太远,如果你想要自由活动,往下看。
保持手机和电脑在同一局域网,使用 adb tcpip 5555
命令。如果出现错误请打开 网络ADB调试
和 开启USB文件传输模式
$ adb tcpip 5555
## 如果出现下面错误,请打开 网络ADB调试 和 开启USB文件传输模式
error: insufficient permissions for device
See [http://developer.android.com/tools/device.html] for more information
$ adb tcpip 5555
## 再试一次就成功了
restarting in TCP mode port: 5555
$ adb connect 192.168.1.3:5555
## 成功连接手机 192.168.1.3 是你手机的ip
connected to 192.168.1.3:5555
$ scrcpy -s 192.168.1.3:5555 --turn-screen-off
## 使用scrcpy控制你的手机

文件同步
安装 syncthing
- 电脑
$ sudo pacman -S syncthing
- 手机
https://syncthing.net/downloads/
开启同步
$ systemctl start syncthing
$ systemctl enable syncthing
手机打开即可
配置 syncthing
自己找摸索一下,找教程看一下,去B站搜,都有教程的
把电脑截图保存的位置和手机文件夹同步一下,这样你电脑截图的图片就会自动同步到你的手机。这样就可以在手机分享你电脑的截图了