2

使用scrcpy控制你的手机

 2 years ago
source link: https://www.lujun9972.win/blog/2019/03/20/%E4%BD%BF%E7%94%A8scrcpy%E6%8E%A7%E5%88%B6%E4%BD%A0%E7%9A%84%E6%89%8B%E6%9C%BA/index.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

使用scrcpy控制你的手机

scrcpy可以借助adb来通过USB控制你的手机。还能对手机进行录屏,特别好玩。

安装android-tools

scrcpy需要借助adb来往手机发送命令的,因此需要先安装 android-tools

sudo pacman -S android-tools --noconfirm

安装scrcpy

sudo pacman -S scrcpy --noconfirm

手机开启USB调试功能

不同手机有不同的开启方式

我用的是MIUI10,开启方法是 "设置"->"我的设备"->"全部参数"->点击7下MIUI版本,开启“开发者选项”

然后在 "设置"->"更多设置"->"开发者选项" 中 同时开启 USB调试USB调试(安全设置)

screenshot-65.png

手机B连接PC

通过USB连接

推荐使用USB连接,这样操作起来比较流畅。

手机通过USB连接到PC上,在弹出的USB用途中选择 传输文件(MTP)

  1. 确保PC和手机在同一Wifi中
  2. 手机先通过USB与PC相连
  3. 在PC上运行 adb tcpip 服务端口
  4. 在PC上运行 adb connect 手机IP:服务端口
  5. 运行scrcpy

运行scrcpy

运行scrcpy,第一次运行手机上会显示是否接受PC的秘钥,选择接受。

然后就能看到出现一个窗口显示手机内容了: screenshot-66.png

scrcpy的操作说明

  • 鼠标左键: 模拟点击
  • 鼠标右键/Ctrl+b: 返回上一页
  • Ctrl+s: 切换app
  • 手机录屏: scrcpy --record file.mp4
  • 帮助信息: scrcpy --help

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK