背景
以前一直使用vysor來控制安卓設(shè)備,但是這個軟件有幾個問題:
- 清晰度不好
- 當(dāng)安卓設(shè)備有視頻播放時,就用不了。
直到今天發(fā)現(xiàn)了一個很好用的電腦控制安卓手機的軟件,而且還是開源的,
地址:https://github.com/Genymobile/scrcpy
使用要求
- 安卓設(shè)備版本5.0以上
- 安卓設(shè)備要打開adb調(diào)試模式
安裝
Windows
32位:https://github.com/Genymobile/scrcpy/releases/download/v1.8/scrcpy-win32-v1.8.zip
64位:https://github.com/Genymobile/scrcpy/releases/download/v1.8/scrcpy-win64-v1.8.zip
Mac
使用Homebrew安裝
brew install scrcpy
Linux
使用
電腦連接安卓設(shè)備
命令行運行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. 默認(rèn)是8M
假設(shè)要設(shè)置為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. 設(shè)置客戶端tcp監(jiān)聽端口
Default is 27183. 默認(rèn)是27183
-s, --serial
The device serial number. Mandatory only if several devices 安卓設(shè)備序列號
are connected to adb.
-t, --show-touches
Enable "show touches" on start, disable on quit. 控制安卓設(shè)置 觸摸顯示效果
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) 切換顯示為安卓設(shè)備分辨率1:1效果
Ctrl+x
Double-click on black borders 也可以顯示界面黑邊雙擊
resize window to remove black borders 來去除黑邊
Ctrl+h
Home
Middle-click 也可以使用鼠標(biāo)中鍵
click on HOME 來返回home界面
Ctrl+b
Ctrl+Backspace
Right-click (when screen is on) 當(dāng)屏幕喚醒時可以使用鼠標(biāo)右鍵
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) 控制屏幕開關(guān)
Right-click (when screen is off) 顯示界面黑屏?xí)r
turn screen on 來打開屏幕
Ctrl+v
paste computer clipboard to device 電腦剪貼板的文字粘貼到安卓設(shè)備上
Ctrl+i
enable/disable FPS counter (print frames/second in logs) 控制fps的顯示
Drag & drop APK file 拖動apk文件
install APK from computer 來安裝apk文件