2023-03-04 07:56:35 +00:00
|
|
|
# Control
|
|
|
|
|
|
|
|
## Read-only
|
|
|
|
|
|
|
|
To disable controls (everything which can interact with the device: input keys,
|
|
|
|
mouse events, drag&drop files):
|
|
|
|
|
|
|
|
```bash
|
|
|
|
scrcpy --no-control
|
|
|
|
scrcpy -n # short version
|
|
|
|
```
|
|
|
|
|
2024-02-29 09:00:56 +00:00
|
|
|
## Keyboard and mouse
|
2023-03-04 07:56:35 +00:00
|
|
|
|
2024-02-29 09:00:56 +00:00
|
|
|
Read [keyboard](keyboard.md) and [mouse](mouse.md).
|
2023-03-04 07:56:35 +00:00
|
|
|
|
|
|
|
|
2024-04-20 16:12:20 +00:00
|
|
|
## Control only
|
|
|
|
|
|
|
|
To control the device without mirroring:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
scrcpy --no-video --no-audio
|
|
|
|
```
|
|
|
|
|
|
|
|
By default, mouse mode is switched to UHID if video mirroring is disabled (a
|
|
|
|
relative mouse mode is required).
|
|
|
|
|
|
|
|
To also use a UHID keyboard, set it explicitly:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
scrcpy --no-video --no-audio --keyboard=uhid
|
|
|
|
scrcpy --no-video --no-audio -K # short version
|
|
|
|
```
|
|
|
|
|
|
|
|
To use AOA instead (over USB only):
|
|
|
|
|
|
|
|
```bash
|
|
|
|
scrcpy --no-video --no-audio --keyboard=aoa --mouse=aoa
|
|
|
|
```
|
|
|
|
|
|
|
|
|
2023-03-04 07:56:35 +00:00
|
|
|
## Copy-paste
|
|
|
|
|
|
|
|
Any time the Android clipboard changes, it is automatically synchronized to the
|
|
|
|
computer clipboard.
|
|
|
|
|
|
|
|
Any <kbd>Ctrl</kbd> shortcut is forwarded to the device. In particular:
|
|
|
|
- <kbd>Ctrl</kbd>+<kbd>c</kbd> typically copies
|
|
|
|
- <kbd>Ctrl</kbd>+<kbd>x</kbd> typically cuts
|
|
|
|
- <kbd>Ctrl</kbd>+<kbd>v</kbd> typically pastes (after computer-to-device
|
|
|
|
clipboard synchronization)
|
|
|
|
|
|
|
|
This typically works as you expect.
|
|
|
|
|
|
|
|
The actual behavior depends on the active application though. For example,
|
|
|
|
_Termux_ sends SIGINT on <kbd>Ctrl</kbd>+<kbd>c</kbd> instead, and _K-9 Mail_
|
|
|
|
composes a new message.
|
|
|
|
|
|
|
|
To copy, cut and paste in such cases (but only supported on Android >= 7):
|
|
|
|
- <kbd>MOD</kbd>+<kbd>c</kbd> injects `COPY`
|
|
|
|
- <kbd>MOD</kbd>+<kbd>x</kbd> injects `CUT`
|
|
|
|
- <kbd>MOD</kbd>+<kbd>v</kbd> injects `PASTE` (after computer-to-device
|
|
|
|
clipboard synchronization)
|
|
|
|
|
|
|
|
In addition, <kbd>MOD</kbd>+<kbd>Shift</kbd>+<kbd>v</kbd> injects the computer
|
|
|
|
clipboard text as a sequence of key events. This is useful when the component
|
|
|
|
does not accept text pasting (for example in _Termux_), but it can break
|
|
|
|
non-ASCII content.
|
|
|
|
|
|
|
|
**WARNING:** Pasting the computer clipboard to the device (either via
|
|
|
|
<kbd>Ctrl</kbd>+<kbd>v</kbd> or <kbd>MOD</kbd>+<kbd>v</kbd>) copies the content
|
|
|
|
into the Android clipboard. As a consequence, any Android application could read
|
|
|
|
its content. You should avoid pasting sensitive content (like passwords) that
|
|
|
|
way.
|
|
|
|
|
|
|
|
Some Android devices do not behave as expected when setting the device clipboard
|
|
|
|
programmatically. An option `--legacy-paste` is provided to change the behavior
|
|
|
|
of <kbd>Ctrl</kbd>+<kbd>v</kbd> and <kbd>MOD</kbd>+<kbd>v</kbd> so that they
|
|
|
|
also inject the computer clipboard text as a sequence of key events (the same
|
|
|
|
way as <kbd>MOD</kbd>+<kbd>Shift</kbd>+<kbd>v</kbd>).
|
|
|
|
|
|
|
|
To disable automatic clipboard synchronization, use
|
|
|
|
`--no-clipboard-autosync`.
|
|
|
|
|
2024-02-29 09:00:56 +00:00
|
|
|
|
2023-12-13 16:04:02 +00:00
|
|
|
## Pinch-to-zoom, rotate and tilt simulation
|
2023-03-04 07:56:35 +00:00
|
|
|
|
|
|
|
To simulate "pinch-to-zoom": <kbd>Ctrl</kbd>+_click-and-move_.
|
|
|
|
|
|
|
|
More precisely, hold down <kbd>Ctrl</kbd> while pressing the left-click button.
|
|
|
|
Until the left-click button is released, all mouse movements scale and rotate
|
|
|
|
the content (if supported by the app) relative to the center of the screen.
|
|
|
|
|
2024-03-02 23:06:54 +00:00
|
|
|
https://github.com/Genymobile/scrcpy/assets/543275/26c4a920-9805-43f1-8d4c-608752d04767
|
|
|
|
|
2023-12-13 16:04:02 +00:00
|
|
|
To simulate a tilt gesture: <kbd>Shift</kbd>+_click-and-move-up-or-down_.
|
|
|
|
|
2024-03-02 23:06:54 +00:00
|
|
|
https://github.com/Genymobile/scrcpy/assets/543275/1e252341-4a90-4b29-9d11-9153b324669f
|
|
|
|
|
2023-03-04 07:56:35 +00:00
|
|
|
Technically, _scrcpy_ generates additional touch events from a "virtual finger"
|
2023-12-13 16:04:02 +00:00
|
|
|
at a location inverted through the center of the screen. When pressing
|
2024-03-02 23:05:26 +00:00
|
|
|
<kbd>Ctrl</kbd> the _x_ and _y_ coordinates are inverted. Using <kbd>Shift</kbd>
|
|
|
|
only inverts _x_.
|
2023-03-04 07:56:35 +00:00
|
|
|
|
2024-02-29 09:00:56 +00:00
|
|
|
This only works for the default mouse mode (`--mouse=sdk`).
|
2023-03-04 07:56:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
## File drop
|
|
|
|
|
|
|
|
### Install APK
|
|
|
|
|
|
|
|
To install an APK, drag & drop an APK file (ending with `.apk`) to the _scrcpy_
|
|
|
|
window.
|
|
|
|
|
|
|
|
There is no visual feedback, a log is printed to the console.
|
|
|
|
|
|
|
|
|
|
|
|
### Push file to device
|
|
|
|
|
|
|
|
To push a file to `/sdcard/Download/` on the device, drag & drop a (non-APK)
|
|
|
|
file to the _scrcpy_ window.
|
|
|
|
|
|
|
|
There is no visual feedback, a log is printed to the console.
|
|
|
|
|
|
|
|
The target directory can be changed on start:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
scrcpy --push-target=/sdcard/Movies/
|
|
|
|
```
|