scrcpy
Display and control your Android device
显示并且控制你得安卓设备
项目地址 https://github.com/Genymobile/scrcpy
使用要求
- 安卓设备版本5.0以上
- 安卓设备要打开adb 调试模式
安装
Win
下载
32位 https://github.com/Genymobile/scrcpy/releases/download/v1.4/scrcpy-win32-v1.4.zip
64位 https://github.com/Genymobile/scrcpy/releases/download/v1.4/scrcpy-win64-v1.4.zip
解压使用
Mac
使用Homebrew安装
brew cask install android-platform-tools
brew install scrcpy
Linux
Arch Linux 可以使用aur安装
- scrcpy
- https://aur.archlinux.org/packages/scrcpy/
- scrcpy-prebuiltserver
- https://aur.archlinux.org/packages/scrcpy-prebuiltserver/
Gentoo可以使用Ebuild安装
使用
电脑连接安卓设备
命令行运行scrcpy
scrcpy命令行说明
Usage: scrcpy [options]
Options:
-b, --bit-rate value 视频显示码率
Encode the video at the given bit-rate, expressed in bits/s.
Unit suffixes are supported: 'K' (x1000) and 'M' (x1000000). 支持单位后缀 K 和 M
Default is 8000000. 默认是8M
假设要设置为2M 2K
scrcpy -b 2m
scrcpy -b 2K
-c, --crop width:height:x:y
Crop the device screen on the server.
The values are expressed in the device natural orientation
(typically, portrait for a phone, landscape for a tablet).
Any --max-size value is computed on the cropped size.
-h, --help //命令行帮助说明
Print this help.
-m, --max-size value
Limit both the width and height of the video to value. The
other dimension is computed so that the device aspect-ratio
is preserved.
Default is 0 (unlimited).
-p, --port port
Set the TCP port the client listens on. 设置客户端tcp监听端口
Default is 27183. 默认是27183
-s, --serial
The device serial number. Mandatory only if several devices 安卓设备序列号
are connected to adb.
-t, --show-touches
Enable "show touches" on start, disable on quit. 控制安卓设置 触摸显示效果
It only shows physical touches (not clicks from scrcpy).
-v, --version
Print the version of scrcpy. 显示scrcpy 版本
Shortcuts: 快捷键
Ctrl+f
switch fullscreen mode 切换显示全屏
Ctrl+g
resize window to 1:1 (pixel-perfect) 切换显示为安卓设备分辨率1:1效果
Ctrl+x
Double-click on black borders 也可以显示界面黑边双击
resize window to remove black borders 来去除黑边
Ctrl+h
Home
Middle-click 也可以使用鼠标中键
click on HOME 来返回home界面
Ctrl+b
Ctrl+Backspace
Right-click (when screen is on) 当屏幕唤醒时可以使用鼠标右键
click on BACK 来返回
Ctrl+s
click on APP_SWITCH app切换界面
Ctrl+m
click on MENU 菜单
Ctrl+Up
click on VOLUME_UP 音量加
Ctrl+Down
click on VOLUME_DOWN 音量减
Ctrl+p
click on POWER (turn screen on/off) 控制屏幕开关
Right-click (when screen is off) 显示界面黑屏时
turn screen on 来打开屏幕
Ctrl+v
paste computer clipboard to device 电脑剪贴板的文字粘贴到安卓设备上
Ctrl+i
enable/disable FPS counter (print frames/second in logs) 控制fps的显示
Drag & drop APK file 拖动apk文件
install APK from computer 来安装apk文件
使用截图
scrcpy -b 2k
scrcpy -b
tips
如果控制安卓设备的时候 觉得图像不同步 就改视频码率吧