Compare commits
30 Commits
fix_androi
...
wayland
Author | SHA1 | Date | |
---|---|---|---|
d6aaa5bf9a | |||
4ab3e89c29 | |||
4bc78244b9 | |||
ea233d811d | |||
ab12b6c981 | |||
376201a83c | |||
60c4e886d4 | |||
ff7baad709 | |||
e712f30ceb | |||
a9d9cbf8b5 | |||
fda32928c1 | |||
710e80aa0d | |||
77e96d745b | |||
1c95043478 | |||
488991116b | |||
5c95d18beb | |||
1039f9b531 | |||
19ca02cd8f | |||
937fa704a6 | |||
7db0189f23 | |||
8b90e1d3f4 | |||
df017160ed | |||
b846d3a085 | |||
d3d955f67b | |||
8121b0b7e7 | |||
2e9d520080 | |||
1b7c9b3e1c | |||
9bed8cf3f4 | |||
72081a241b | |||
42b3d1e66e |
6
BUILD.md
6
BUILD.md
@ -268,10 +268,10 @@ install` must be run as root)._
|
|||||||
|
|
||||||
#### Option 2: Use prebuilt server
|
#### Option 2: Use prebuilt server
|
||||||
|
|
||||||
- [`scrcpy-server-v1.17`][direct-scrcpy-server]
|
- [`scrcpy-server-v1.18`][direct-scrcpy-server]
|
||||||
_(SHA-256: 11b5ad2d1bc9b9730fb7254a78efd71a8ff46b1938ff468e47a21b653a1b6725)_
|
_(SHA-256: 641c5c6beda9399dfae72d116f5ff43b5ed1059d871c9ebc3f47610fd33c51a3)_
|
||||||
|
|
||||||
[direct-scrcpy-server]: https://github.com/Genymobile/scrcpy/releases/download/v1.17/scrcpy-server-v1.17
|
[direct-scrcpy-server]: https://github.com/Genymobile/scrcpy/releases/download/v1.18/scrcpy-server-v1.18
|
||||||
|
|
||||||
Download the prebuilt server somewhere, and specify its path during the Meson
|
Download the prebuilt server somewhere, and specify its path during the Meson
|
||||||
configuration:
|
configuration:
|
||||||
|
@ -76,7 +76,7 @@ The server uses 3 threads:
|
|||||||
- the **main** thread, encoding and streaming the video to the client;
|
- the **main** thread, encoding and streaming the video to the client;
|
||||||
- the **controller** thread, listening for _control messages_ (typically,
|
- the **controller** thread, listening for _control messages_ (typically,
|
||||||
keyboard and mouse events) from the client;
|
keyboard and mouse events) from the client;
|
||||||
- the **receiver** thread (managed by the controller), sending _device messges_
|
- the **receiver** thread (managed by the controller), sending _device messages_
|
||||||
to the clients (currently, it is only used to send the device clipboard
|
to the clients (currently, it is only used to send the device clipboard
|
||||||
content).
|
content).
|
||||||
|
|
||||||
|
217
FAQ.it.md
Normal file
217
FAQ.it.md
Normal file
@ -0,0 +1,217 @@
|
|||||||
|
_Apri le [FAQ](FAQ.md) originali e sempre aggiornate._
|
||||||
|
|
||||||
|
# Domande Frequenti (FAQ)
|
||||||
|
|
||||||
|
Questi sono i problemi più comuni riportati e i loro stati.
|
||||||
|
|
||||||
|
|
||||||
|
## Problemi di `adb`
|
||||||
|
|
||||||
|
`scrcpy` esegue comandi `adb` per inizializzare la connessione con il dispositivo. Se `adb` fallisce, scrcpy non funzionerà.
|
||||||
|
|
||||||
|
In questo caso sarà stampato questo errore:
|
||||||
|
|
||||||
|
> ERROR: "adb push" returned with value 1
|
||||||
|
|
||||||
|
Questo solitamente non è un bug di _scrcpy_, ma un problema del tuo ambiente.
|
||||||
|
|
||||||
|
Per trovare la causa, esegui:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb devices
|
||||||
|
```
|
||||||
|
|
||||||
|
### `adb` not found (`adb` non trovato)
|
||||||
|
|
||||||
|
È necessario che `adb` sia accessibile dal tuo `PATH`.
|
||||||
|
|
||||||
|
In Windows, la cartella corrente è nel tuo `PATH` e `adb.exe` è incluso nella release, perciò dovrebbe già essere pronto all'uso.
|
||||||
|
|
||||||
|
|
||||||
|
### Device unauthorized (Dispositivo non autorizzato)
|
||||||
|
|
||||||
|
Controlla [stackoverflow][device-unauthorized] (in inglese).
|
||||||
|
|
||||||
|
[device-unauthorized]: https://stackoverflow.com/questions/23081263/adb-android-device-unauthorized
|
||||||
|
|
||||||
|
|
||||||
|
### Device not detected (Dispositivo non rilevato)
|
||||||
|
|
||||||
|
> adb: error: failed to get feature set: no devices/emulators found
|
||||||
|
|
||||||
|
Controlla di aver abilitato correttamente il [debug con adb][enable-adb] (link in inglese).
|
||||||
|
|
||||||
|
Se il tuo dispositivo non è rilevato, potresti avere bisogno dei [driver][drivers] (link in inglese) (in Windows).
|
||||||
|
|
||||||
|
[enable-adb]: https://developer.android.com/studio/command-line/adb.html#Enabling
|
||||||
|
[drivers]: https://developer.android.com/studio/run/oem-usb.html
|
||||||
|
|
||||||
|
|
||||||
|
### Più dispositivi connessi
|
||||||
|
|
||||||
|
Se più dispositivi sono connessi, riscontrerai questo errore:
|
||||||
|
|
||||||
|
> adb: error: failed to get feature set: more than one device/emulator
|
||||||
|
|
||||||
|
l'identificatore del tuo dispositivo deve essere fornito:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy -s 01234567890abcdef
|
||||||
|
```
|
||||||
|
|
||||||
|
Notare che se il tuo dispositivo è connesso mediante TCP/IP, riscontrerai questo messaggio:
|
||||||
|
|
||||||
|
> adb: error: more than one device/emulator
|
||||||
|
> ERROR: "adb reverse" returned with value 1
|
||||||
|
> WARN: 'adb reverse' failed, fallback to 'adb forward'
|
||||||
|
|
||||||
|
Questo è un problema atteso (a causa di un bug di una vecchia versione di Android, vedi [#5] (link in inglese)), ma in quel caso scrcpy ripiega su un metodo differente, il quale dovrebbe funzionare.
|
||||||
|
|
||||||
|
[#5]: https://github.com/Genymobile/scrcpy/issues/5
|
||||||
|
|
||||||
|
|
||||||
|
### Conflitti tra versioni di adb
|
||||||
|
|
||||||
|
> adb server version (41) doesn't match this client (39); killing...
|
||||||
|
|
||||||
|
L'errore compare quando usi più versioni di `adb` simultaneamente. Devi trovare il programma che sta utilizzando una versione differente di `adb` e utilizzare la stessa versione dappertutto.
|
||||||
|
|
||||||
|
Puoi sovrascrivere i binari di `adb` nell'altro programma, oppure chiedere a _scrcpy_ di usare un binario specifico di `adb`, impostando la variabile d'ambiente `ADB`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
set ADB=/path/to/your/adb
|
||||||
|
scrcpy
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Device disconnected (Dispositivo disconnesso)
|
||||||
|
|
||||||
|
Se _scrcpy_ si interrompe con l'avviso "Device disconnected", allora la connessione `adb` è stata chiusa.
|
||||||
|
|
||||||
|
Prova con un altro cavo USB o inseriscilo in un'altra porta USB. Vedi [#281] (in inglese) e [#283] (in inglese).
|
||||||
|
|
||||||
|
[#281]: https://github.com/Genymobile/scrcpy/issues/281
|
||||||
|
[#283]: https://github.com/Genymobile/scrcpy/issues/283
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Problemi di controllo
|
||||||
|
|
||||||
|
### Mouse e tastiera non funzionano
|
||||||
|
|
||||||
|
Su alcuni dispositivi potresti dover abilitare un opzione che permette l'[input simulato][simulating input] (link in inglese). Nelle opzioni sviluppatore, abilita:
|
||||||
|
|
||||||
|
> **Debug USB (Impostazioni di sicurezza)**
|
||||||
|
> _Permetti la concessione dei permessi e la simulazione degli input mediante il debug USB_
|
||||||
|
<!--- Ho tradotto personalmente il testo sopra, non conosco esattamente il testo reale --->
|
||||||
|
|
||||||
|
[simulating input]: https://github.com/Genymobile/scrcpy/issues/70#issuecomment-373286323
|
||||||
|
|
||||||
|
|
||||||
|
### I caratteri speciali non funzionano
|
||||||
|
|
||||||
|
Iniettare del testo in input è [limitato ai caratteri ASCII][text-input] (link in inglese). Un trucco permette di iniettare dei [caratteri accentati][accented-characters] (link in inglese), ma questo è tutto. Vedi [#37] (link in inglese).
|
||||||
|
|
||||||
|
[text-input]: https://github.com/Genymobile/scrcpy/issues?q=is%3Aopen+is%3Aissue+label%3Aunicode
|
||||||
|
[accented-characters]: https://blog.rom1v.com/2018/03/introducing-scrcpy/#handle-accented-characters
|
||||||
|
[#37]: https://github.com/Genymobile/scrcpy/issues/37
|
||||||
|
|
||||||
|
|
||||||
|
## Problemi del client
|
||||||
|
|
||||||
|
### La qualità è bassa
|
||||||
|
|
||||||
|
Se la definizione della finestra del tuo client è minore di quella del tuo dispositivo, allora potresti avere una bassa qualità di visualizzazione, specialmente individuabile nei testi (vedi [#40] (link in inglese)).
|
||||||
|
|
||||||
|
[#40]: https://github.com/Genymobile/scrcpy/issues/40
|
||||||
|
|
||||||
|
Per migliorare la qualità di ridimensionamento (downscaling), il filtro trilineare è applicato automaticamente se il renderizzatore è OpenGL e se supporta la creazione di mipmap.
|
||||||
|
|
||||||
|
In Windows, potresti voler forzare OpenGL:
|
||||||
|
|
||||||
|
```
|
||||||
|
scrcpy --render-driver=opengl
|
||||||
|
```
|
||||||
|
|
||||||
|
Potresti anche dover configurare il [comportamento di ridimensionamento][scaling behavior] (link in inglese):
|
||||||
|
|
||||||
|
> `scrcpy.exe` > Propietà > Compatibilità > Modifica impostazioni DPI elevati > Esegui l'override del comportamento di ridimensionamento DPI elevati > Ridimensionamento eseguito per: _Applicazione_.
|
||||||
|
|
||||||
|
[scaling behavior]: https://github.com/Genymobile/scrcpy/issues/40#issuecomment-424466723
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Crash del compositore KWin
|
||||||
|
|
||||||
|
In Plasma Desktop, il compositore è disabilitato mentre _scrcpy_ è in esecuzione.
|
||||||
|
|
||||||
|
Come soluzione alternativa, [disattiva la "composizione dei blocchi"][kwin] (link in inglese).
|
||||||
|
<!--- Non sono sicuro di aver tradotto correttamente la stringa di testo del pulsante --->
|
||||||
|
|
||||||
|
[kwin]: https://github.com/Genymobile/scrcpy/issues/114#issuecomment-378778613
|
||||||
|
|
||||||
|
|
||||||
|
## Crash
|
||||||
|
|
||||||
|
### Eccezione
|
||||||
|
|
||||||
|
Ci potrebbero essere molte ragioni. Una causa comune è che il codificatore hardware del tuo dispositivo non riesce a codificare alla definizione selezionata:
|
||||||
|
|
||||||
|
> ```
|
||||||
|
> ERROR: Exception on thread Thread[main,5,main]
|
||||||
|
> android.media.MediaCodec$CodecException: Error 0xfffffc0e
|
||||||
|
> ...
|
||||||
|
> Exit due to uncaughtException in main thread:
|
||||||
|
> ERROR: Could not open video stream
|
||||||
|
> INFO: Initial texture: 1080x2336
|
||||||
|
> ```
|
||||||
|
|
||||||
|
o
|
||||||
|
|
||||||
|
> ```
|
||||||
|
> ERROR: Exception on thread Thread[main,5,main]
|
||||||
|
> java.lang.IllegalStateException
|
||||||
|
> at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
|
||||||
|
> ```
|
||||||
|
|
||||||
|
Prova con una definizione inferiore:
|
||||||
|
|
||||||
|
```
|
||||||
|
scrcpy -m 1920
|
||||||
|
scrcpy -m 1024
|
||||||
|
scrcpy -m 800
|
||||||
|
```
|
||||||
|
|
||||||
|
Potresti anche provare un altro [codificatore](README.it.md#codificatore).
|
||||||
|
|
||||||
|
|
||||||
|
## Linea di comando in Windows
|
||||||
|
|
||||||
|
Alcuni utenti Windows non sono familiari con la riga di comando. Qui è descritto come aprire un terminale ed eseguire `scrcpy` con gli argomenti:
|
||||||
|
|
||||||
|
1. Premi <kbd>Windows</kbd>+<kbd>r</kbd>, questo apre una finestra di dialogo.
|
||||||
|
2. Scrivi `cmd` e premi <kbd>Enter</kbd>, questo apre un terminale.
|
||||||
|
3. Vai nella tua cartella di _scrcpy_ scrivendo (adatta il percorso):
|
||||||
|
|
||||||
|
```bat
|
||||||
|
cd C:\Users\user\Downloads\scrcpy-win64-xxx
|
||||||
|
```
|
||||||
|
|
||||||
|
e premi <kbd>Enter</kbd>
|
||||||
|
4. Scrivi il tuo comando. Per esempio:
|
||||||
|
|
||||||
|
```bat
|
||||||
|
scrcpy --record file.mkv
|
||||||
|
```
|
||||||
|
|
||||||
|
Se pianifichi di utilizzare sempre gli stessi argomenti, crea un file `myscrcpy.bat` (abilita mostra [estensioni nomi file][show file extensions] per evitare di far confusione) contenente il tuo comando nella cartella di `scrcpy`. Per esempio:
|
||||||
|
|
||||||
|
```bat
|
||||||
|
scrcpy --prefer-text --turn-screen-off --stay-awake
|
||||||
|
```
|
||||||
|
|
||||||
|
Poi fai doppio click su quel file.
|
||||||
|
|
||||||
|
Potresti anche modificare (una copia di) `scrcpy-console.bat` o `scrcpy-noconsole.vbs` per aggiungere alcuni argomenti.
|
||||||
|
|
||||||
|
[show file extensions]: https://www.techpedia.it/14-windows/windows-10/171-visualizzare-le-estensioni-nomi-file-con-windows-10
|
30
FAQ.md
30
FAQ.md
@ -1,5 +1,7 @@
|
|||||||
# Frequently Asked Questions
|
# Frequently Asked Questions
|
||||||
|
|
||||||
|
[Read in another language](#translations)
|
||||||
|
|
||||||
Here are the common reported problems and their status.
|
Here are the common reported problems and their status.
|
||||||
|
|
||||||
|
|
||||||
@ -151,6 +153,26 @@ You may also need to configure the [scaling behavior]:
|
|||||||
[scaling behavior]: https://github.com/Genymobile/scrcpy/issues/40#issuecomment-424466723
|
[scaling behavior]: https://github.com/Genymobile/scrcpy/issues/40#issuecomment-424466723
|
||||||
|
|
||||||
|
|
||||||
|
### Issue with Wayland
|
||||||
|
|
||||||
|
By default, SDL uses x11 on Linux. The [video driver] can be changed via the
|
||||||
|
`SDL_VIDEODRIVER` environment variable:
|
||||||
|
|
||||||
|
[video driver]: https://wiki.libsdl.org/FAQUsingSDL#how_do_i_choose_a_specific_video_driver
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export SDL_VIDEODRIVER=wayland
|
||||||
|
scrcpy
|
||||||
|
```
|
||||||
|
|
||||||
|
On some distributions (at least Fedora), the package `libdecor` must be
|
||||||
|
installed manually.
|
||||||
|
|
||||||
|
See issues [#2554] and [#2559].
|
||||||
|
|
||||||
|
[#2554]: https://github.com/Genymobile/scrcpy/issues/2554
|
||||||
|
[#2559]: https://github.com/Genymobile/scrcpy/issues/2559
|
||||||
|
|
||||||
|
|
||||||
### KWin compositor crashes
|
### KWin compositor crashes
|
||||||
|
|
||||||
@ -230,3 +252,11 @@ You could also edit (a copy of) `scrcpy-console.bat` or `scrcpy-noconsole.vbs`
|
|||||||
to add some arguments.
|
to add some arguments.
|
||||||
|
|
||||||
[show file extensions]: https://www.howtogeek.com/205086/beginner-how-to-make-windows-show-file-extensions/
|
[show file extensions]: https://www.howtogeek.com/205086/beginner-how-to-make-windows-show-file-extensions/
|
||||||
|
|
||||||
|
|
||||||
|
## Translations
|
||||||
|
|
||||||
|
This FAQ is available in other languages:
|
||||||
|
|
||||||
|
- [Italiano (Italiano, `it`) - v1.17](FAQ.it.md)
|
||||||
|
- [한국어 (Korean, `ko`) - v1.11](FAQ.ko.md)
|
||||||
|
742
README.it.md
Normal file
742
README.it.md
Normal file
@ -0,0 +1,742 @@
|
|||||||
|
_Apri il [README](README.md) originale e sempre aggiornato._
|
||||||
|
|
||||||
|
# scrcpy (v1.17)
|
||||||
|
|
||||||
|
Questa applicazione fornisce la visualizzazione e il controllo dei dispositivi Android collegati via USB (o [via TCP/IP][article-tcpip]). Non richiede alcun accesso _root_.
|
||||||
|
Funziona su _GNU/Linux_, _Windows_ e _macOS_.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Si concentra su:
|
||||||
|
|
||||||
|
- **leggerezza** (nativo, mostra solo lo schermo del dispositivo)
|
||||||
|
- **prestazioni** (30~60fps)
|
||||||
|
- **qualità** (1920×1080 o superiore)
|
||||||
|
- **bassa latenza** ([35~70ms][lowlatency])
|
||||||
|
- **tempo di avvio basso** (~ 1secondo per visualizzare la prima immagine)
|
||||||
|
- **non invadenza** (nulla viene lasciato installato sul dispositivo)
|
||||||
|
|
||||||
|
[lowlatency]: https://github.com/Genymobile/scrcpy/pull/646
|
||||||
|
|
||||||
|
|
||||||
|
## Requisiti
|
||||||
|
|
||||||
|
Il dispositivo Android richiede almeno le API 21 (Android 5.0).
|
||||||
|
|
||||||
|
Assiucurati di aver [attivato il debug usb][enable-adb] sul(/i) tuo(i) dispositivo(/i).
|
||||||
|
|
||||||
|
[enable-adb]: https://developer.android.com/studio/command-line/adb.html#Enabling
|
||||||
|
|
||||||
|
In alcuni dispositivi, devi anche abilitare [un'opzione aggiuntiva][control] per controllarli con tastiera e mouse.
|
||||||
|
|
||||||
|
[control]: https://github.com/Genymobile/scrcpy/issues/70#issuecomment-373286323
|
||||||
|
|
||||||
|
## Ottieni l'app
|
||||||
|
|
||||||
|
<a href="https://repology.org/project/scrcpy/versions"><img src="https://repology.org/badge/vertical-allrepos/scrcpy.svg" alt="Packaging status" align="right"></a>
|
||||||
|
|
||||||
|
### Sommario
|
||||||
|
|
||||||
|
- Linux: `apt install scrcpy`
|
||||||
|
- Windows: [download](README.md#windows)
|
||||||
|
- macOS: `brew install scrcpy`
|
||||||
|
|
||||||
|
Compila dai sorgenti: [BUILD] (in inglese) ([procedimento semplificato][BUILD_simple] (in inglese))
|
||||||
|
|
||||||
|
[BUILD]: BUILD.md
|
||||||
|
[BUILD_simple]: BUILD.md#simple
|
||||||
|
|
||||||
|
|
||||||
|
### Linux
|
||||||
|
|
||||||
|
Su Debian (_testing_ e _sid_ per ora) e Ubuntu (20.04):
|
||||||
|
|
||||||
|
```
|
||||||
|
apt install scrcpy
|
||||||
|
```
|
||||||
|
|
||||||
|
È disponibile anche un pacchetto [Snap]: [`scrcpy`][snap-link].
|
||||||
|
|
||||||
|
[snap-link]: https://snapstats.org/snaps/scrcpy
|
||||||
|
|
||||||
|
[snap]: https://it.wikipedia.org/wiki/Snappy_(gestore_pacchetti)
|
||||||
|
|
||||||
|
Per Fedora, è disponibile un pacchetto [COPR]: [`scrcpy`][copr-link].
|
||||||
|
|
||||||
|
[COPR]: https://fedoraproject.org/wiki/Category:Copr
|
||||||
|
[copr-link]: https://copr.fedorainfracloud.org/coprs/zeno/scrcpy/
|
||||||
|
|
||||||
|
Per Arch Linux, è disponibile un pacchetto [AUR]: [`scrcpy`][aur-link].
|
||||||
|
|
||||||
|
[AUR]: https://wiki.archlinux.org/index.php/Arch_User_Repository
|
||||||
|
[aur-link]: https://aur.archlinux.org/packages/scrcpy/
|
||||||
|
|
||||||
|
Per Gentoo, è disponibile una [Ebuild]: [`scrcpy/`][ebuild-link].
|
||||||
|
|
||||||
|
[Ebuild]: https://wiki.gentoo.org/wiki/Ebuild
|
||||||
|
[ebuild-link]: https://github.com/maggu2810/maggu2810-overlay/tree/master/app-mobilephone/scrcpy
|
||||||
|
|
||||||
|
Puoi anche [compilare l'app manualmente][BUILD] (in inglese) ([procedimento semplificato][BUILD_simple] (in inglese)).
|
||||||
|
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
Per Windows, per semplicità è disponibile un archivio precompilato con tutte le dipendenze (incluso `adb`):
|
||||||
|
|
||||||
|
- [README](README.md#windows) (Link al README originale per l'ultima versione)
|
||||||
|
|
||||||
|
È anche disponibile in [Chocolatey]:
|
||||||
|
|
||||||
|
[Chocolatey]: https://chocolatey.org/
|
||||||
|
|
||||||
|
```bash
|
||||||
|
choco install scrcpy
|
||||||
|
choco install adb # se non lo hai già
|
||||||
|
```
|
||||||
|
|
||||||
|
E in [Scoop]:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scoop install scrcpy
|
||||||
|
scoop install adb # se non lo hai già
|
||||||
|
```
|
||||||
|
|
||||||
|
[Scoop]: https://scoop.sh
|
||||||
|
|
||||||
|
Puoi anche [compilare l'app manualmente][BUILD] (in inglese).
|
||||||
|
|
||||||
|
|
||||||
|
### macOS
|
||||||
|
|
||||||
|
L'applicazione è disponibile in [Homebrew]. Basta installarlo:
|
||||||
|
|
||||||
|
[Homebrew]: https://brew.sh/
|
||||||
|
|
||||||
|
```bash
|
||||||
|
brew install scrcpy
|
||||||
|
```
|
||||||
|
|
||||||
|
Serve che `adb` sia accessibile dal tuo `PATH`. Se non lo hai già:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
brew install android-platform-tools
|
||||||
|
```
|
||||||
|
|
||||||
|
È anche disponibile in [MacPorts], che imposta adb per te:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo port install scrcpy
|
||||||
|
```
|
||||||
|
|
||||||
|
[MacPorts]: https://www.macports.org/
|
||||||
|
|
||||||
|
|
||||||
|
Puoi anche [compilare l'app manualmente][BUILD] (in inglese).
|
||||||
|
|
||||||
|
|
||||||
|
## Esecuzione
|
||||||
|
|
||||||
|
Collega un dispositivo Android ed esegui:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy
|
||||||
|
```
|
||||||
|
|
||||||
|
Scrcpy accetta argomenti da riga di comando, essi sono listati con:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --help
|
||||||
|
```
|
||||||
|
|
||||||
|
## Funzionalità
|
||||||
|
|
||||||
|
### Configurazione di acquisizione
|
||||||
|
|
||||||
|
#### Riduci dimensione
|
||||||
|
|
||||||
|
Qualche volta è utile trasmettere un dispositvo Android ad una definizione inferiore per aumentare le prestazioni.
|
||||||
|
|
||||||
|
Per limitare sia larghezza che altezza ad un certo valore (ad es. 1024):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --max-size 1024
|
||||||
|
scrcpy -m 1024 # versione breve
|
||||||
|
```
|
||||||
|
|
||||||
|
L'altra dimensione è calcolata in modo tale che il rapporto di forma del dispositivo sia preservato.
|
||||||
|
In questo esempio un dispositivo in 1920x1080 viene trasmesso a 1024x576.
|
||||||
|
|
||||||
|
|
||||||
|
#### Cambia bit-rate (velocità di trasmissione)
|
||||||
|
|
||||||
|
Il bit-rate predefinito è 8 Mbps. Per cambiare il bitrate video (ad es. a 2 Mbps):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --bit-rate 2M
|
||||||
|
scrcpy -b 2M # versione breve
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Limitare il frame rate (frequenza di fotogrammi)
|
||||||
|
|
||||||
|
Il frame rate di acquisizione può essere limitato:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --max-fps 15
|
||||||
|
```
|
||||||
|
|
||||||
|
Questo è supportato ufficialmente a partire da Android 10, ma potrebbe funzionare in versioni precedenti.
|
||||||
|
|
||||||
|
#### Ritaglio
|
||||||
|
|
||||||
|
Lo schermo del dispositivo può essere ritagliato per visualizzare solo parte di esso.
|
||||||
|
|
||||||
|
Questo può essere utile, per esempio, per trasmettere solo un occhio dell'Oculus Go:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --crop 1224:1440:0:0 # 1224x1440 at offset (0,0)
|
||||||
|
```
|
||||||
|
|
||||||
|
Se anche `--max-size` è specificata, il ridimensionamento è applicato dopo il ritaglio.
|
||||||
|
|
||||||
|
|
||||||
|
#### Blocca orientamento del video
|
||||||
|
|
||||||
|
|
||||||
|
Per bloccare l'orientamento della trasmissione:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --lock-video-orientation 0 # orientamento naturale
|
||||||
|
scrcpy --lock-video-orientation 1 # 90° antiorario
|
||||||
|
scrcpy --lock-video-orientation 2 # 180°
|
||||||
|
scrcpy --lock-video-orientation 3 # 90° orario
|
||||||
|
```
|
||||||
|
|
||||||
|
Questo influisce sull'orientamento della registrazione.
|
||||||
|
|
||||||
|
|
||||||
|
La [finestra può anche essere ruotata](#rotazione) indipendentemente.
|
||||||
|
|
||||||
|
|
||||||
|
#### Codificatore
|
||||||
|
|
||||||
|
Alcuni dispositivi hanno più di un codificatore e alcuni di questi possono provocare problemi o crash. È possibile selezionare un encoder diverso:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --encoder OMX.qcom.video.encoder.avc
|
||||||
|
```
|
||||||
|
|
||||||
|
Per elencare i codificatori disponibili puoi immettere un nome di codificatore non valido e l'errore mostrerà i codificatori disponibili:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --encoder _
|
||||||
|
```
|
||||||
|
|
||||||
|
### Registrazione
|
||||||
|
|
||||||
|
È possibile registrare lo schermo durante la trasmissione:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --record file.mp4
|
||||||
|
scrcpy -r file.mkv
|
||||||
|
```
|
||||||
|
|
||||||
|
Per disabilitare la trasmissione durante la registrazione:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --no-display --record file.mp4
|
||||||
|
scrcpy -Nr file.mkv
|
||||||
|
# interrompere la registrazione con Ctrl+C
|
||||||
|
```
|
||||||
|
|
||||||
|
I "fotogrammi saltati" sono registrati nonostante non siano mostrati in tempo reale (per motivi di prestazioni). I fotogrammi sono _datati_ sul dispositivo, così una [variazione di latenza dei pacchetti][packet delay variation] non impatta il file registrato.
|
||||||
|
|
||||||
|
[packet delay variation]: https://en.wikipedia.org/wiki/Packet_delay_variation
|
||||||
|
|
||||||
|
|
||||||
|
### Connessione
|
||||||
|
|
||||||
|
#### Wireless
|
||||||
|
|
||||||
|
|
||||||
|
_Scrcpy_ usa `adb` per comunicare col dispositivo e `adb` può [connettersi][connect] al dispositivo mediante TCP/IP:
|
||||||
|
|
||||||
|
1. Connetti il dispositivo alla stessa rete Wi-Fi del tuo computer.
|
||||||
|
2. Trova l'indirizzo IP del tuo dispositivo in Impostazioni → Informazioni sul telefono → Stato, oppure eseguendo questo comando:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb shell ip route | awk '{print $9}'
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Abilita adb via TCP/IP sul tuo dispositivo: `adb tcpip 5555`.
|
||||||
|
4. Scollega il tuo dispositivo.
|
||||||
|
5. Connetti il tuo dispositivo: `adb connect IP_DISPOSITVO:5555` _(rimpiazza `IP_DISPOSITIVO`)_.
|
||||||
|
6. Esegui `scrcpy` come al solito.
|
||||||
|
|
||||||
|
Potrebbe essere utile diminuire il bit-rate e la definizione
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --bit-rate 2M --max-size 800
|
||||||
|
scrcpy -b2M -m800 # versione breve
|
||||||
|
```
|
||||||
|
|
||||||
|
[connect]: https://developer.android.com/studio/command-line/adb.html#wireless
|
||||||
|
|
||||||
|
|
||||||
|
#### Multi dispositivo
|
||||||
|
|
||||||
|
Se in `adb devices` sono listati più dispositivi, è necessario specificare il _seriale_:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --serial 0123456789abcdef
|
||||||
|
scrcpy -s 0123456789abcdef # versione breve
|
||||||
|
```
|
||||||
|
|
||||||
|
Se il dispositivo è collegato mediante TCP/IP:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --serial 192.168.0.1:5555
|
||||||
|
scrcpy -s 192.168.0.1:5555 # versione breve
|
||||||
|
```
|
||||||
|
|
||||||
|
Puoi avviare più istanze di _scrcpy_ per diversi dispositivi.
|
||||||
|
|
||||||
|
|
||||||
|
#### Avvio automativo alla connessione del dispositivo
|
||||||
|
|
||||||
|
Potresti usare [AutoAdb]:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
autoadb scrcpy -s '{}'
|
||||||
|
```
|
||||||
|
|
||||||
|
[AutoAdb]: https://github.com/rom1v/autoadb
|
||||||
|
|
||||||
|
#### Tunnel SSH
|
||||||
|
|
||||||
|
Per connettersi a un dispositivo remoto è possibile collegare un client `adb` locale ad un server `adb` remoto (assunto che entrambi stiano usando la stessa versione del protocollo _adb_):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb kill-server # termina il server adb locale su 5037
|
||||||
|
ssh -CN -L5037:localhost:5037 -R27183:localhost:27183 your_remote_computer
|
||||||
|
# tieni questo aperto
|
||||||
|
```
|
||||||
|
|
||||||
|
Da un altro terminale:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy
|
||||||
|
```
|
||||||
|
|
||||||
|
Per evitare l'abilitazione dell'apertura porte remota potresti invece forzare una "forward connection" (notare il `-L` invece di `-R`)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb kill-server # termina il server adb locale su 5037
|
||||||
|
ssh -CN -L5037:localhost:5037 -L27183:localhost:27183 your_remote_computer
|
||||||
|
# tieni questo aperto
|
||||||
|
```
|
||||||
|
|
||||||
|
Da un altro terminale:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --force-adb-forward
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Come per le connessioni wireless potrebbe essere utile ridurre la qualità:
|
||||||
|
|
||||||
|
```
|
||||||
|
scrcpy -b2M -m800 --max-fps 15
|
||||||
|
```
|
||||||
|
|
||||||
|
### Configurazione della finestra
|
||||||
|
|
||||||
|
#### Titolo
|
||||||
|
|
||||||
|
Il titolo della finestra è il modello del dispositivo per impostazione predefinita. Esso può essere cambiato:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --window-title 'My device'
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Posizione e dimensione
|
||||||
|
|
||||||
|
La posizione e la dimensione iniziale della finestra può essere specificata:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --window-x 100 --window-y 100 --window-width 800 --window-height 600
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Senza bordi
|
||||||
|
|
||||||
|
Per disabilitare le decorazioni della finestra:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --window-borderless
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Sempre in primo piano
|
||||||
|
|
||||||
|
Per tenere scrcpy sempre in primo piano:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --always-on-top
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Schermo intero
|
||||||
|
|
||||||
|
L'app può essere avviata direttamente a schermo intero:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --fullscreen
|
||||||
|
scrcpy -f # versione breve
|
||||||
|
```
|
||||||
|
|
||||||
|
Lo schermo intero può anche essere attivato/disattivato con <kbd>MOD</kbd>+<kbd>f</kbd>.
|
||||||
|
|
||||||
|
#### Rotazione
|
||||||
|
|
||||||
|
La finestra può essere ruotata:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --rotation 1
|
||||||
|
```
|
||||||
|
|
||||||
|
I valori possibili sono:
|
||||||
|
- `0`: nessuna rotazione
|
||||||
|
- `1`: 90 gradi antiorari
|
||||||
|
- `2`: 180 gradi
|
||||||
|
- `3`: 90 gradi orari
|
||||||
|
|
||||||
|
La rotazione può anche essere cambiata dinamicamente con <kbd>MOD</kbd>+<kbd>←</kbd>
|
||||||
|
_(sinistra)_ e <kbd>MOD</kbd>+<kbd>→</kbd> _(destra)_.
|
||||||
|
|
||||||
|
Notare che _scrcpy_ gestisce 3 diversi tipi di rotazione:
|
||||||
|
- <kbd>MOD</kbd>+<kbd>r</kbd> richiede al dispositvo di cambiare tra orientamento verticale (portrait) e orizzontale (landscape) (l'app in uso potrebbe rifiutarsi se non supporta l'orientamento richiesto).
|
||||||
|
- [`--lock-video-orientation`](#blocca-orientamento-del-video) cambia l'orientamento della trasmissione (l'orientamento del video inviato dal dispositivo al computer). Questo influenza la registrazione.
|
||||||
|
- `--rotation` (o <kbd>MOD</kbd>+<kbd>←</kbd>/<kbd>MOD</kbd>+<kbd>→</kbd>) ruota solo il contenuto della finestra. Questo influenza solo la visualizzazione, non la registrazione.
|
||||||
|
|
||||||
|
|
||||||
|
### Altre opzioni di trasmissione
|
||||||
|
|
||||||
|
#### "Sola lettura"
|
||||||
|
|
||||||
|
Per disabilitare i controlli (tutto ciò che può interagire col dispositivo: tasti di input, eventi del mouse, trascina e rilascia (drag&drop) file):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --no-control
|
||||||
|
scrcpy -n
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Schermo
|
||||||
|
|
||||||
|
Se sono disponibili più schermi, è possibile selezionare lo schermo da trasmettere:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --display 1
|
||||||
|
```
|
||||||
|
|
||||||
|
La lista degli id schermo può essere ricavata da:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb shell dumpsys display # cerca "mDisplayId=" nell'output
|
||||||
|
```
|
||||||
|
|
||||||
|
Lo schermo secondario potrebbe essere possibile controllarlo solo se il dispositivo esegue almeno Android 10 (in caso contrario è trasmesso in modalità sola lettura).
|
||||||
|
|
||||||
|
|
||||||
|
#### Mantenere sbloccato
|
||||||
|
|
||||||
|
Per evitare che il dispositivo si blocchi dopo un po' che il dispositivo è collegato:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --stay-awake
|
||||||
|
scrcpy -w
|
||||||
|
```
|
||||||
|
|
||||||
|
Lo stato iniziale è ripristinato quando scrcpy viene chiuso.
|
||||||
|
|
||||||
|
|
||||||
|
#### Spegnere lo schermo
|
||||||
|
|
||||||
|
È possibile spegnere lo schermo del dispositivo durante la trasmissione con un'opzione da riga di comando:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --turn-screen-off
|
||||||
|
scrcpy -S
|
||||||
|
```
|
||||||
|
|
||||||
|
Oppure premendo <kbd>MOD</kbd>+<kbd>o</kbd> in qualsiasi momento.
|
||||||
|
|
||||||
|
Per riaccenderlo premere <kbd>MOD</kbd>+<kbd>Shift</kbd>+<kbd>o</kbd>.
|
||||||
|
|
||||||
|
In Android il pulsante `POWER` (tasto di accensione) accende sempre lo schermo. Per comodità, se `POWER` è inviato via scrcpy (con click destro o con <kbd>MOD</kbd>+<kbd>p</kbd>), si forza il dispositivo a spegnere lo schermo dopo un piccolo ritardo (appena possibile).
|
||||||
|
Il pulsante fisico `POWER` continuerà ad accendere lo schermo normalmente.
|
||||||
|
|
||||||
|
Può anche essere utile evitare il blocco del dispositivo:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --turn-screen-off --stay-awake
|
||||||
|
scrcpy -Sw
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Renderizzare i fotogrammi scaduti
|
||||||
|
|
||||||
|
Per minimizzare la latenza _scrcpy_ renderizza sempre l'ultimo fotogramma decodificato disponibile in maniera predefinita e tralascia quelli precedenti.
|
||||||
|
|
||||||
|
Per forzare la renderizzazione di tutti i fotogrammi (a costo di una possibile latenza superiore), utilizzare:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --render-expired-frames
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Mostrare i tocchi
|
||||||
|
|
||||||
|
Per le presentazioni può essere utile mostrare i tocchi fisici (sul dispositivo fisico).
|
||||||
|
|
||||||
|
Android fornisce questa funzionalità nelle _Opzioni sviluppatore_.
|
||||||
|
|
||||||
|
_Scrcpy_ fornisce un'opzione per abilitare questa funzionalità all'avvio e ripristinare il valore iniziale alla chiusura:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --show-touches
|
||||||
|
scrcpy -t
|
||||||
|
```
|
||||||
|
|
||||||
|
Notare che mostra solo i tocchi _fisici_ (con le dita sul dispositivo).
|
||||||
|
|
||||||
|
|
||||||
|
#### Disabilitare il salvaschermo
|
||||||
|
|
||||||
|
In maniera predefinita scrcpy non previene l'attivazione del salvaschermo del computer.
|
||||||
|
|
||||||
|
Per disabilitarlo:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --disable-screensaver
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Input di controlli
|
||||||
|
|
||||||
|
#### Rotazione dello schermo del dispostivo
|
||||||
|
|
||||||
|
Premere <kbd>MOD</kbd>+<kbd>r</kbd> per cambiare tra le modalità verticale (portrait) e orizzontale (landscape).
|
||||||
|
|
||||||
|
Notare che la rotazione avviene solo se l'applicazione in primo piano supporta l'orientamento richiesto.
|
||||||
|
|
||||||
|
#### Copia-incolla
|
||||||
|
|
||||||
|
Quando gli appunti di Android cambiano, essi vengono automaticamente sincronizzati con gli appunti del computer.
|
||||||
|
|
||||||
|
Qualsiasi scorciatoia <kbd>Ctrl</kbd> viene inoltrata al dispositivo. In particolare:
|
||||||
|
- <kbd>Ctrl</kbd>+<kbd>c</kbd> copia
|
||||||
|
- <kbd>Ctrl</kbd>+<kbd>x</kbd> taglia
|
||||||
|
- <kbd>Ctrl</kbd>+<kbd>v</kbd> incolla (dopo la sincronizzazione degli appunti da computer a dispositivo)
|
||||||
|
|
||||||
|
Questo solitamente funziona nella maniera più comune.
|
||||||
|
|
||||||
|
Il comportamento reale, però, dipende dall'applicazione attiva. Per esempio _Termux_ invia SIGINT con <kbd>Ctrl</kbd>+<kbd>c</kbd>, e _K-9 Mail_ compone un nuovo messaggio.
|
||||||
|
|
||||||
|
Per copiare, tagliare e incollare in questi casi (ma è solo supportato in Android >= 7):
|
||||||
|
- <kbd>MOD</kbd>+<kbd>c</kbd> inietta `COPY`
|
||||||
|
- <kbd>MOD</kbd>+<kbd>x</kbd> inietta `CUT`
|
||||||
|
- <kbd>MOD</kbd>+<kbd>v</kbd> inietta `PASTE` (dopo la sincronizzazione degli appunti da computer a dispositivo)
|
||||||
|
|
||||||
|
In aggiunta, <kbd>MOD</kbd>+<kbd>Shift</kbd>+<kbd>v</kbd> permette l'iniezione del testo degli appunti del computer come una sequenza di eventi pressione dei tasti. Questo è utile quando il componente non accetta l'incollaggio di testo (per esempio in _Termux_), ma questo può rompere il contenuto non ASCII.
|
||||||
|
|
||||||
|
**AVVISO:** Incollare gli appunti del computer nel dispositivo (sia con <kbd>Ctrl</kbd>+<kbd>v</kbd> che con <kbd>MOD</kbd>+<kbd>v</kbd>) copia il contenuto negli appunti del dispositivo. Come conseguenza, qualsiasi applicazione Android potrebbe leggere il suo contenuto. Dovresti evitare di incollare contenuti sensibili (come password) in questa maniera.
|
||||||
|
|
||||||
|
Alcuni dispositivi non si comportano come aspettato quando si modificano gli appunti del dispositivo a livello di codice. L'opzione `--legacy-paste` è fornita per cambiare il comportamento di <kbd>Ctrl</kbd>+<kbd>v</kbd> and <kbd>MOD</kbd>+<kbd>v</kbd> in modo tale che anch'essi iniettino il testo gli appunti del computer come una sequenza di eventi pressione dei tasti (nella stessa maniera di <kbd>MOD</kbd>+<kbd>Shift</kbd>+<kbd>v</kbd>).
|
||||||
|
|
||||||
|
#### Pizzica per zoomare (pinch-to-zoom)
|
||||||
|
|
||||||
|
Per simulare il "pizzica per zoomare": <kbd>Ctrl</kbd>+_click e trascina_.
|
||||||
|
|
||||||
|
Più precisamente, tieni premuto <kbd>Ctrl</kbd> mentre premi il pulsante sinistro. Finchè il pulsante non sarà rilasciato, tutti i movimenti del mouse ridimensioneranno e ruoteranno il contenuto (se supportato dall'applicazione) relativamente al centro dello schermo.
|
||||||
|
|
||||||
|
Concretamente scrcpy genera degli eventi di tocco addizionali di un "dito virtuale" nella posizione simmetricamente opposta rispetto al centro dello schermo.
|
||||||
|
|
||||||
|
|
||||||
|
#### Preferenze di iniezione del testo
|
||||||
|
|
||||||
|
Ci sono due tipi di [eventi][textevents] generati quando si scrive testo:
|
||||||
|
- _eventi di pressione_, segnalano che tasto è stato premuto o rilasciato;
|
||||||
|
- _eventi di testo_, segnalano che del testo è stato inserito.
|
||||||
|
|
||||||
|
In maniera predefinita le lettere sono "iniettate" usando gli eventi di pressione, in maniera tale che la tastiera si comporti come aspettato nei giochi (come accade solitamente per i tasti WASD).
|
||||||
|
|
||||||
|
Questo, però, può [causare problemi][prefertext]. Se incontri un problema del genere, puoi evitarlo con:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --prefer-text
|
||||||
|
```
|
||||||
|
|
||||||
|
(ma questo romperà il normale funzionamento della tastiera nei giochi)
|
||||||
|
|
||||||
|
[textevents]: https://blog.rom1v.com/2018/03/introducing-scrcpy/#handle-text-input
|
||||||
|
[prefertext]: https://github.com/Genymobile/scrcpy/issues/650#issuecomment-512945343
|
||||||
|
|
||||||
|
|
||||||
|
#### Ripetizione di tasti
|
||||||
|
|
||||||
|
In maniera predefinita tenere premuto un tasto genera una ripetizione degli eventi di pressione di tale tasto. Questo può creare problemi di performance in alcuni giochi, dove questi eventi sono inutilizzati.
|
||||||
|
|
||||||
|
Per prevenire l'inoltro ripetuto degli eventi di pressione:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --no-key-repeat
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Click destro e click centrale
|
||||||
|
|
||||||
|
In maniera predefinita, click destro aziona BACK (indietro) e il click centrale aziona HOME. Per disabilitare queste scorciatoie e, invece, inviare i click al dispositivo:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --forward-all-clicks
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Rilascio di file
|
||||||
|
|
||||||
|
#### Installare APK
|
||||||
|
|
||||||
|
Per installare un APK, trascina e rilascia un file APK (finisce con `.apk`) nella finestra di _scrcpy_.
|
||||||
|
|
||||||
|
Non c'è alcuna risposta visiva, un log è stampato nella console.
|
||||||
|
|
||||||
|
|
||||||
|
#### Trasferimento di file verso il dispositivo
|
||||||
|
|
||||||
|
Per trasferire un file in `/sdcard/` del dispositivo trascina e rilascia un file (non APK) nella finestra di _scrcpy_.
|
||||||
|
|
||||||
|
Non c'è alcuna risposta visiva, un log è stampato nella console.
|
||||||
|
|
||||||
|
La cartella di destinazione può essere cambiata all'avvio:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --push-target=/sdcard/Download/
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Inoltro dell'audio
|
||||||
|
|
||||||
|
L'audio non è inoltrato da _scrcpy_. Usa [sndcpy].
|
||||||
|
|
||||||
|
Vedi anche la [issue #14].
|
||||||
|
|
||||||
|
[sndcpy]: https://github.com/rom1v/sndcpy
|
||||||
|
[issue #14]: https://github.com/Genymobile/scrcpy/issues/14
|
||||||
|
|
||||||
|
|
||||||
|
## Scociatoie
|
||||||
|
|
||||||
|
Nella lista seguente, <kbd>MOD</kbd> è il modificatore delle scorciatoie. In maniera predefinita è <kbd>Alt</kbd> (sinistro) o <kbd>Super</kbd> (sinistro).
|
||||||
|
|
||||||
|
Può essere cambiato usando `--shortcut-mod`. I tasti possibili sono `lctrl`, `rctrl`, `lalt`, `ralt`, `lsuper` and `rsuper` (`l` significa sinistro e `r` significa destro). Per esempio:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# usa ctrl destro per le scorciatoie
|
||||||
|
scrcpy --shortcut-mod=rctrl
|
||||||
|
|
||||||
|
# use sia "ctrl sinistro"+"alt sinistro" che "super sinistro" per le scorciatoie
|
||||||
|
scrcpy --shortcut-mod=lctrl+lalt,lsuper
|
||||||
|
```
|
||||||
|
|
||||||
|
_<kbd>[Super]</kbd> è il pulsante <kbd>Windows</kbd> o <kbd>Cmd</kbd>._
|
||||||
|
|
||||||
|
[Super]: https://it.wikipedia.org/wiki/Tasto_Windows
|
||||||
|
<!-- https://en.wikipedia.org/wiki/Super_key_(keyboard_button) è la pagina originale di Wikipedia inglese, l'ho sostituita con una simile in quello italiano -->
|
||||||
|
|
||||||
|
| Azione | Scorciatoia
|
||||||
|
| ------------------------------------------- |:-----------------------------
|
||||||
|
| Schermo intero | <kbd>MOD</kbd>+<kbd>f</kbd>
|
||||||
|
| Rotazione schermo a sinistra | <kbd>MOD</kbd>+<kbd>←</kbd> _(sinistra)_
|
||||||
|
| Rotazione schermo a destra | <kbd>MOD</kbd>+<kbd>→</kbd> _(destra)_
|
||||||
|
| Ridimensiona finestra a 1:1 (pixel-perfect) | <kbd>MOD</kbd>+<kbd>g</kbd>
|
||||||
|
| Ridimensiona la finestra per rimuovere i bordi neri | <kbd>MOD</kbd>+<kbd>w</kbd> \| _Doppio click¹_
|
||||||
|
| Premi il tasto `HOME` | <kbd>MOD</kbd>+<kbd>h</kbd> \| _Click centrale_
|
||||||
|
| Premi il tasto `BACK` | <kbd>MOD</kbd>+<kbd>b</kbd> \| _Click destro²_
|
||||||
|
| Premi il tasto `APP_SWITCH` | <kbd>MOD</kbd>+<kbd>s</kbd>
|
||||||
|
| Premi il tasto `MENU` (sblocca lo schermo) | <kbd>MOD</kbd>+<kbd>m</kbd>
|
||||||
|
| Premi il tasto `VOLUME_UP` | <kbd>MOD</kbd>+<kbd>↑</kbd> _(su)_
|
||||||
|
| Premi il tasto `VOLUME_DOWN` | <kbd>MOD</kbd>+<kbd>↓</kbd> _(giù)_
|
||||||
|
| Premi il tasto `POWER` | <kbd>MOD</kbd>+<kbd>p</kbd>
|
||||||
|
| Accendi | _Click destro²_
|
||||||
|
| Spegni lo schermo del dispositivo (continua a trasmettere) | <kbd>MOD</kbd>+<kbd>o</kbd>
|
||||||
|
| Accendi lo schermo del dispositivo | <kbd>MOD</kbd>+<kbd>Shift</kbd>+<kbd>o</kbd>
|
||||||
|
| Ruota lo schermo del dispositivo | <kbd>MOD</kbd>+<kbd>r</kbd>
|
||||||
|
| Espandi il pannello delle notifiche | <kbd>MOD</kbd>+<kbd>n</kbd>
|
||||||
|
| Chiudi il pannello delle notifiche | <kbd>MOD</kbd>+<kbd>Shift</kbd>+<kbd>n</kbd>
|
||||||
|
| Copia negli appunti³ | <kbd>MOD</kbd>+<kbd>c</kbd>
|
||||||
|
| Taglia negli appunti³ | <kbd>MOD</kbd>+<kbd>x</kbd>
|
||||||
|
| Sincronizza gli appunti e incolla³ | <kbd>MOD</kbd>+<kbd>v</kbd>
|
||||||
|
| Inietta il testo degli appunti del computer | <kbd>MOD</kbd>+<kbd>Shift</kbd>+<kbd>v</kbd>
|
||||||
|
| Abilita/Disabilita il contatore FPS (su stdout) | <kbd>MOD</kbd>+<kbd>i</kbd>
|
||||||
|
| Pizzica per zoomare | <kbd>Ctrl</kbd>+_click e trascina_
|
||||||
|
|
||||||
|
_¹Doppio click sui bordi neri per rimuoverli._
|
||||||
|
_²Il tasto destro accende lo schermo se era spento, preme BACK in caso contrario._
|
||||||
|
_³Solo in Android >= 7._
|
||||||
|
|
||||||
|
Tutte le scorciatoie <kbd>Ctrl</kbd>+_tasto_ sono inoltrate al dispositivo, così sono gestite dall'applicazione attiva.
|
||||||
|
|
||||||
|
## Path personalizzati
|
||||||
|
|
||||||
|
Per utilizzare dei binari _adb_ specifici, configura il suo path nella variabile d'ambente `ADB`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ADB=/percorso/per/adb scrcpy
|
||||||
|
```
|
||||||
|
|
||||||
|
Per sovrascrivere il percorso del file `scrcpy-server`, configura il percorso in `SCRCPY_SERVER_PATH`.
|
||||||
|
|
||||||
|
## Perchè _scrcpy_?
|
||||||
|
|
||||||
|
Un collega mi ha sfidato a trovare un nome tanto impronunciabile quanto [gnirehtet].
|
||||||
|
|
||||||
|
[`strcpy`] copia una **str**ing (stringa); `scrcpy` copia uno **scr**een (schermo).
|
||||||
|
|
||||||
|
[gnirehtet]: https://github.com/Genymobile/gnirehtet
|
||||||
|
[`strcpy`]: http://man7.org/linux/man-pages/man3/strcpy.3.html
|
||||||
|
|
||||||
|
## Come compilare?
|
||||||
|
|
||||||
|
Vedi [BUILD] (in inglese).
|
||||||
|
|
||||||
|
|
||||||
|
## Problemi comuni
|
||||||
|
|
||||||
|
Vedi le [FAQ](FAQ.it.md).
|
||||||
|
|
||||||
|
|
||||||
|
## Sviluppatori
|
||||||
|
|
||||||
|
Leggi la [pagina per sviluppatori].
|
||||||
|
|
||||||
|
[pagina per sviluppatori]: DEVELOP.md
|
||||||
|
|
||||||
|
|
||||||
|
## Licenza (in inglese)
|
||||||
|
|
||||||
|
Copyright (C) 2018 Genymobile
|
||||||
|
Copyright (C) 2018-2021 Romain Vimont
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
## Articoli (in inglese)
|
||||||
|
|
||||||
|
- [Introducendo scrcpy][article-intro]
|
||||||
|
- [Scrcpy ora funziona wireless][article-tcpip]
|
||||||
|
|
||||||
|
[article-intro]: https://blog.rom1v.com/2018/03/introducing-scrcpy/
|
||||||
|
[article-tcpip]: https://www.genymotion.com/blog/open-source-project-scrcpy-now-works-wirelessly/
|
@ -112,7 +112,7 @@ scrcpy --help
|
|||||||
### 캡쳐 환경 설정
|
### 캡쳐 환경 설정
|
||||||
|
|
||||||
|
|
||||||
###사이즈 재정의
|
### 사이즈 재정의
|
||||||
|
|
||||||
가끔씩 성능을 향상시키기위해 안드로이드 디바이스를 낮은 해상도에서 미러링하는 것이 유용할 때도 있습니다.
|
가끔씩 성능을 향상시키기위해 안드로이드 디바이스를 낮은 해상도에서 미러링하는 것이 유용할 때도 있습니다.
|
||||||
|
|
||||||
@ -136,7 +136,7 @@ scrcpy --bit-rate 2M
|
|||||||
scrcpy -b 2M # 축약 버전
|
scrcpy -b 2M # 축약 버전
|
||||||
```
|
```
|
||||||
|
|
||||||
###프레임 비율 제한
|
### 프레임 비율 제한
|
||||||
|
|
||||||
안드로이드 버전 10이상의 디바이스에서는, 다음의 명령어로 캡쳐 화면의 프레임 비율을 제한할 수 있습니다:
|
안드로이드 버전 10이상의 디바이스에서는, 다음의 명령어로 캡쳐 화면의 프레임 비율을 제한할 수 있습니다:
|
||||||
|
|
||||||
|
19
README.md
19
README.md
@ -1,4 +1,4 @@
|
|||||||
# scrcpy (v1.17)
|
# scrcpy (v1.18)
|
||||||
|
|
||||||
[Read in another language](#translations)
|
[Read in another language](#translations)
|
||||||
|
|
||||||
@ -88,10 +88,10 @@ process][BUILD_simple]).
|
|||||||
For Windows, for simplicity, a prebuilt archive with all the dependencies
|
For Windows, for simplicity, a prebuilt archive with all the dependencies
|
||||||
(including `adb`) is available:
|
(including `adb`) is available:
|
||||||
|
|
||||||
- [`scrcpy-win64-v1.17.zip`][direct-win64]
|
- [`scrcpy-win64-v1.18.zip`][direct-win64]
|
||||||
_(SHA-256: 8b9e57993c707367ed10ebfe0e1ef563c7a29d9af4a355cd8b6a52a317c73eea)_
|
_(SHA-256: 37212f5087fe6f3e258f1d44fa5c02207496b30e1d7ec442cbcf8358910a5c63)_
|
||||||
|
|
||||||
[direct-win64]: https://github.com/Genymobile/scrcpy/releases/download/v1.17/scrcpy-win64-v1.17.zip
|
[direct-win64]: https://github.com/Genymobile/scrcpy/releases/download/v1.18/scrcpy-win64-v1.18.zip
|
||||||
|
|
||||||
It is also available in [Chocolatey]:
|
It is also available in [Chocolatey]:
|
||||||
|
|
||||||
@ -318,7 +318,7 @@ vlc v4l2:///dev/videoN # VLC might add some buffering delay
|
|||||||
|
|
||||||
For example, you could capture the video within [OBS].
|
For example, you could capture the video within [OBS].
|
||||||
|
|
||||||
[OBS]: https://obsproject.com/fr
|
[OBS]: https://obsproject.com/
|
||||||
|
|
||||||
|
|
||||||
### Connection
|
### Connection
|
||||||
@ -516,7 +516,7 @@ scrcpy --display 1
|
|||||||
|
|
||||||
The list of display ids can be retrieved by:
|
The list of display ids can be retrieved by:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
adb shell dumpsys display # search "mDisplayId=" in the output
|
adb shell dumpsys display # search "mDisplayId=" in the output
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -801,7 +801,9 @@ handled by the active application.
|
|||||||
To use a specific _adb_ binary, configure its path in the environment variable
|
To use a specific _adb_ binary, configure its path in the environment variable
|
||||||
`ADB`:
|
`ADB`:
|
||||||
|
|
||||||
ADB=/path/to/adb scrcpy
|
```bash
|
||||||
|
ADB=/path/to/adb scrcpy
|
||||||
|
```
|
||||||
|
|
||||||
To override the path of the `scrcpy-server` file, configure its path in
|
To override the path of the `scrcpy-server` file, configure its path in
|
||||||
`SCRCPY_SERVER_PATH`.
|
`SCRCPY_SERVER_PATH`.
|
||||||
@ -866,10 +868,13 @@ Read the [developers page].
|
|||||||
This README is available in other languages:
|
This README is available in other languages:
|
||||||
|
|
||||||
- [Indonesian (Indonesia, `id`) - v1.16](README.id.md)
|
- [Indonesian (Indonesia, `id`) - v1.16](README.id.md)
|
||||||
|
- [Italiano (Italiano, `it`) - v1.17](README.it.md)
|
||||||
- [日本語 (Japanese, `jp`) - v1.17](README.jp.md)
|
- [日本語 (Japanese, `jp`) - v1.17](README.jp.md)
|
||||||
- [한국어 (Korean, `ko`) - v1.11](README.ko.md)
|
- [한국어 (Korean, `ko`) - v1.11](README.ko.md)
|
||||||
- [português brasileiro (Brazilian Portuguese, `pt-BR`) - v1.17](README.pt-br.md)
|
- [português brasileiro (Brazilian Portuguese, `pt-BR`) - v1.17](README.pt-br.md)
|
||||||
|
- [Español (Spanish, `sp`) - v1.17](README.sp.md)
|
||||||
- [简体中文 (Simplified Chinese, `zh-Hans`) - v1.17](README.zh-Hans.md)
|
- [简体中文 (Simplified Chinese, `zh-Hans`) - v1.17](README.zh-Hans.md)
|
||||||
- [繁體中文 (Traditional Chinese, `zh-Hant`) - v1.15](README.zh-Hant.md)
|
- [繁體中文 (Traditional Chinese, `zh-Hant`) - v1.15](README.zh-Hant.md)
|
||||||
|
- [Turkish (Turkish, `tr`) - v1.18](README.tr.md)
|
||||||
|
|
||||||
Only this README file is guaranteed to be up-to-date.
|
Only this README file is guaranteed to be up-to-date.
|
||||||
|
743
README.sp.md
Normal file
743
README.sp.md
Normal file
@ -0,0 +1,743 @@
|
|||||||
|
Solo se garantiza que el archivo [README](README.md) original esté actualizado.
|
||||||
|
|
||||||
|
# scrcpy (v1.17)
|
||||||
|
|
||||||
|
Esta aplicación proporciona imagen y control de un dispositivo Android conectado
|
||||||
|
por USB (o [por TCP/IP][article-tcpip]). No requiere acceso _root_.
|
||||||
|
Compatible con _GNU/Linux_, _Windows_ y _macOS_.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Sus características principales son:
|
||||||
|
|
||||||
|
- **ligero** (nativo, solo muestra la imagen del dispositivo)
|
||||||
|
- **desempeño** (30~60fps)
|
||||||
|
- **calidad** (1920×1080 o superior)
|
||||||
|
- **baja latencia** ([35~70ms][lowlatency])
|
||||||
|
- **corto tiempo de inicio** (~1 segundo para mostrar la primera imagen)
|
||||||
|
- **no intrusivo** (no se deja nada instalado en el dispositivo)
|
||||||
|
|
||||||
|
[lowlatency]: https://github.com/Genymobile/scrcpy/pull/646
|
||||||
|
|
||||||
|
|
||||||
|
## Requisitos
|
||||||
|
|
||||||
|
El dispositivo Android requiere como mínimo API 21 (Android 5.0).
|
||||||
|
|
||||||
|
Asegurate de [habilitar el adb debugging][enable-adb] en tu(s) dispositivo(s).
|
||||||
|
|
||||||
|
[enable-adb]: https://developer.android.com/studio/command-line/adb.html#Enabling
|
||||||
|
|
||||||
|
En algunos dispositivos, también necesitas habilitar [una opción adicional][control] para controlarlo con el teclado y ratón.
|
||||||
|
|
||||||
|
[control]: https://github.com/Genymobile/scrcpy/issues/70#issuecomment-373286323
|
||||||
|
|
||||||
|
|
||||||
|
## Consigue la app
|
||||||
|
|
||||||
|
<a href="https://repology.org/project/scrcpy/versions"><img src="https://repology.org/badge/vertical-allrepos/scrcpy.svg" alt="Packaging status" align="right"></a>
|
||||||
|
|
||||||
|
### Resumen
|
||||||
|
|
||||||
|
- Linux: `apt install scrcpy`
|
||||||
|
- Windows: [download](README.md#windows)
|
||||||
|
- macOS: `brew install scrcpy`
|
||||||
|
|
||||||
|
Construir desde la fuente: [BUILD] ([proceso simplificado][BUILD_simple])
|
||||||
|
|
||||||
|
[BUILD]: BUILD.md
|
||||||
|
[BUILD_simple]: BUILD.md#simple
|
||||||
|
|
||||||
|
|
||||||
|
### Linux
|
||||||
|
|
||||||
|
En Debian (_test_ y _sid_ por ahora) y Ubuntu (20.04):
|
||||||
|
|
||||||
|
```
|
||||||
|
apt install scrcpy
|
||||||
|
```
|
||||||
|
|
||||||
|
Hay un paquete [Snap]: [`scrcpy`][snap-link].
|
||||||
|
|
||||||
|
[snap-link]: https://snapstats.org/snaps/scrcpy
|
||||||
|
|
||||||
|
[snap]: https://en.wikipedia.org/wiki/Snappy_(package_manager)
|
||||||
|
|
||||||
|
Para Fedora, hay un paquete [COPR]: [`scrcpy`][copr-link].
|
||||||
|
|
||||||
|
[COPR]: https://fedoraproject.org/wiki/Category:Copr
|
||||||
|
[copr-link]: https://copr.fedorainfracloud.org/coprs/zeno/scrcpy/
|
||||||
|
|
||||||
|
Para Arch Linux, hay un paquete [AUR]: [`scrcpy`][aur-link].
|
||||||
|
|
||||||
|
[AUR]: https://wiki.archlinux.org/index.php/Arch_User_Repository
|
||||||
|
[aur-link]: https://aur.archlinux.org/packages/scrcpy/
|
||||||
|
|
||||||
|
Para Gentoo, hay un paquete [Ebuild]: [`scrcpy/`][ebuild-link].
|
||||||
|
|
||||||
|
[Ebuild]: https://wiki.gentoo.org/wiki/Ebuild
|
||||||
|
[ebuild-link]: https://github.com/maggu2810/maggu2810-overlay/tree/master/app-mobilephone/scrcpy
|
||||||
|
|
||||||
|
También puedes [construir la aplicación manualmente][BUILD] ([proceso simplificado][BUILD_simple]).
|
||||||
|
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
Para Windows, por simplicidad, hay un pre-compilado con todas las dependencias
|
||||||
|
(incluyendo `adb`):
|
||||||
|
|
||||||
|
- [README](README.md#windows)
|
||||||
|
|
||||||
|
También está disponible en [Chocolatey]:
|
||||||
|
|
||||||
|
[Chocolatey]: https://chocolatey.org/
|
||||||
|
|
||||||
|
```bash
|
||||||
|
choco install scrcpy
|
||||||
|
choco install adb # si aún no está instalado
|
||||||
|
```
|
||||||
|
|
||||||
|
Y en [Scoop]:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scoop install scrcpy
|
||||||
|
scoop install adb # si aún no está instalado
|
||||||
|
```
|
||||||
|
|
||||||
|
[Scoop]: https://scoop.sh
|
||||||
|
|
||||||
|
También puedes [construir la aplicación manualmente][BUILD].
|
||||||
|
|
||||||
|
|
||||||
|
### macOS
|
||||||
|
|
||||||
|
La aplicación está disponible en [Homebrew]. Solo instalala:
|
||||||
|
|
||||||
|
[Homebrew]: https://brew.sh/
|
||||||
|
|
||||||
|
```bash
|
||||||
|
brew install scrcpy
|
||||||
|
```
|
||||||
|
|
||||||
|
Necesitarás `adb`, accesible desde `PATH`. Si aún no lo tienes:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
brew install android-platform-tools
|
||||||
|
```
|
||||||
|
|
||||||
|
También está disponible en [MacPorts], que configurará el adb automáticamente:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo port install scrcpy
|
||||||
|
```
|
||||||
|
|
||||||
|
[MacPorts]: https://www.macports.org/
|
||||||
|
|
||||||
|
|
||||||
|
También puedes [construir la aplicación manualmente][BUILD].
|
||||||
|
|
||||||
|
|
||||||
|
## Ejecutar
|
||||||
|
|
||||||
|
Enchufa el dispositivo Android, y ejecuta:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy
|
||||||
|
```
|
||||||
|
|
||||||
|
Acepta argumentos desde la línea de comandos, listados en:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --help
|
||||||
|
```
|
||||||
|
|
||||||
|
## Características
|
||||||
|
|
||||||
|
### Capturar configuración
|
||||||
|
|
||||||
|
#### Reducir la definición
|
||||||
|
|
||||||
|
A veces es útil reducir la definición de la imagen del dispositivo Android para aumentar el desempeño.
|
||||||
|
|
||||||
|
Para limitar el ancho y la altura a un valor específico (ej. 1024):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --max-size 1024
|
||||||
|
scrcpy -m 1024 # versión breve
|
||||||
|
```
|
||||||
|
|
||||||
|
La otra dimensión es calculada para conservar el aspect ratio del dispositivo.
|
||||||
|
De esta forma, un dispositivo en 1920×1080 será transmitido a 1024×576.
|
||||||
|
|
||||||
|
|
||||||
|
#### Cambiar el bit-rate
|
||||||
|
|
||||||
|
El bit-rate por defecto es 8 Mbps. Para cambiar el bit-rate del video (ej. a 2 Mbps):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --bit-rate 2M
|
||||||
|
scrcpy -b 2M # versión breve
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Limitar los fps
|
||||||
|
|
||||||
|
El fps puede ser limitado:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --max-fps 15
|
||||||
|
```
|
||||||
|
|
||||||
|
Es oficialmente soportado desde Android 10, pero puede funcionar en versiones anteriores.
|
||||||
|
|
||||||
|
#### Recortar
|
||||||
|
|
||||||
|
La imagen del dispositivo puede ser recortada para transmitir solo una parte de la pantalla.
|
||||||
|
|
||||||
|
Por ejemplo, puede ser útil para transmitir la imagen de un solo ojo del Oculus Go:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --crop 1224:1440:0:0 # 1224x1440 con coordenadas de origen en (0,0)
|
||||||
|
```
|
||||||
|
|
||||||
|
Si `--max-size` también está especificado, el cambio de tamaño es aplicado después de cortar.
|
||||||
|
|
||||||
|
|
||||||
|
#### Fijar la rotación del video
|
||||||
|
|
||||||
|
|
||||||
|
Para fijar la rotación de la transmisión:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --lock-video-orientation 0 # orientación normal
|
||||||
|
scrcpy --lock-video-orientation 1 # 90° contrarreloj
|
||||||
|
scrcpy --lock-video-orientation 2 # 180°
|
||||||
|
scrcpy --lock-video-orientation 3 # 90° sentido de las agujas del reloj
|
||||||
|
```
|
||||||
|
|
||||||
|
Esto afecta la rotación de la grabación.
|
||||||
|
|
||||||
|
La [ventana también puede ser rotada](#rotación) independientemente.
|
||||||
|
|
||||||
|
|
||||||
|
#### Codificador
|
||||||
|
|
||||||
|
Algunos dispositivos pueden tener más de una rotación, y algunos pueden causar problemas o errores. Es posible seleccionar un codificador diferente:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --encoder OMX.qcom.video.encoder.avc
|
||||||
|
```
|
||||||
|
|
||||||
|
Para listar los codificadores disponibles, puedes pasar un nombre de codificador inválido, el error te dará los codificadores disponibles:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --encoder _
|
||||||
|
```
|
||||||
|
|
||||||
|
### Grabación
|
||||||
|
|
||||||
|
Es posible grabar la pantalla mientras se transmite:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --record file.mp4
|
||||||
|
scrcpy -r file.mkv
|
||||||
|
```
|
||||||
|
|
||||||
|
Para grabar sin transmitir la pantalla:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --no-display --record file.mp4
|
||||||
|
scrcpy -Nr file.mkv
|
||||||
|
# interrumpe la grabación con Ctrl+C
|
||||||
|
```
|
||||||
|
|
||||||
|
"Skipped frames" son grabados, incluso si no son mostrados en tiempo real (por razones de desempeño). Los frames tienen _marcas de tiempo_ en el dispositivo, por lo que el "[packet delay
|
||||||
|
variation]" no impacta el archivo grabado.
|
||||||
|
|
||||||
|
[packet delay variation]: https://en.wikipedia.org/wiki/Packet_delay_variation
|
||||||
|
|
||||||
|
|
||||||
|
### Conexión
|
||||||
|
|
||||||
|
#### Inalámbrica
|
||||||
|
|
||||||
|
_Scrcpy_ usa `adb` para comunicarse con el dispositivo, y `adb` puede [conectarse] vía TCP/IP:
|
||||||
|
|
||||||
|
1. Conecta el dispositivo al mismo Wi-Fi que tu computadora.
|
||||||
|
2. Obtén la dirección IP del dispositivo, en Ajustes → Acerca del dispositivo → Estado, o ejecutando este comando:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb shell ip route | awk '{print $9}'
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Habilita adb vía TCP/IP en el dispositivo: `adb tcpip 5555`.
|
||||||
|
4. Desenchufa el dispositivo.
|
||||||
|
5. Conéctate a tu dispositivo: `adb connect IP_DEL_DISPOSITIVO:5555` _(reemplaza `IP_DEL_DISPOSITIVO`)_.
|
||||||
|
6. Ejecuta `scrcpy` con normalidad.
|
||||||
|
|
||||||
|
Podría resultar útil reducir el bit-rate y la definición:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --bit-rate 2M --max-size 800
|
||||||
|
scrcpy -b2M -m800 # versión breve
|
||||||
|
```
|
||||||
|
|
||||||
|
[conectarse]: https://developer.android.com/studio/command-line/adb.html#wireless
|
||||||
|
|
||||||
|
|
||||||
|
#### Múltiples dispositivos
|
||||||
|
|
||||||
|
Si hay muchos dispositivos listados en `adb devices`, será necesario especificar el _número de serie_:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --serial 0123456789abcdef
|
||||||
|
scrcpy -s 0123456789abcdef # versión breve
|
||||||
|
```
|
||||||
|
|
||||||
|
Si el dispositivo está conectado por TCP/IP:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --serial 192.168.0.1:5555
|
||||||
|
scrcpy -s 192.168.0.1:5555 # versión breve
|
||||||
|
```
|
||||||
|
|
||||||
|
Puedes iniciar múltiples instancias de _scrcpy_ para múltiples dispositivos.
|
||||||
|
|
||||||
|
#### Autoiniciar al detectar dispositivo
|
||||||
|
|
||||||
|
Puedes utilizar [AutoAdb]:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
autoadb scrcpy -s '{}'
|
||||||
|
```
|
||||||
|
|
||||||
|
[AutoAdb]: https://github.com/rom1v/autoadb
|
||||||
|
|
||||||
|
#### Túnel SSH
|
||||||
|
|
||||||
|
Para conectarse a un dispositivo remoto, es posible conectar un cliente local de `adb` a un servidor remoto `adb` (siempre y cuando utilicen la misma versión de protocolos _adb_):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb kill-server # cierra el servidor local adb en 5037
|
||||||
|
ssh -CN -L5037:localhost:5037 -R27183:localhost:27183 your_remote_computer
|
||||||
|
# conserva este servidor abierto
|
||||||
|
```
|
||||||
|
|
||||||
|
Desde otra terminal:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy
|
||||||
|
```
|
||||||
|
|
||||||
|
Para evitar habilitar "remote port forwarding", puedes forzar una "forward connection" (nótese el argumento `-L` en vez de `-R`):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb kill-server # cierra el servidor local adb en 5037
|
||||||
|
ssh -CN -L5037:localhost:5037 -L27183:localhost:27183 your_remote_computer
|
||||||
|
# conserva este servidor abierto
|
||||||
|
```
|
||||||
|
|
||||||
|
Desde otra terminal:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --force-adb-forward
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Al igual que las conexiones inalámbricas, puede resultar útil reducir la calidad:
|
||||||
|
|
||||||
|
```
|
||||||
|
scrcpy -b2M -m800 --max-fps 15
|
||||||
|
```
|
||||||
|
|
||||||
|
### Configuración de la ventana
|
||||||
|
|
||||||
|
#### Título
|
||||||
|
|
||||||
|
Por defecto, el título de la ventana es el modelo del dispositivo. Puede ser modificado:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --window-title 'My device'
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Posición y tamaño
|
||||||
|
|
||||||
|
La posición y tamaño inicial de la ventana puede ser especificado:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --window-x 100 --window-y 100 --window-width 800 --window-height 600
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Sin bordes
|
||||||
|
|
||||||
|
Para deshabilitar el diseño de la ventana:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --window-borderless
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Siempre adelante
|
||||||
|
|
||||||
|
Para mantener la ventana de scrcpy siempre adelante:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --always-on-top
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Pantalla completa
|
||||||
|
|
||||||
|
La aplicación puede ser iniciada en pantalla completa:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --fullscreen
|
||||||
|
scrcpy -f # versión breve
|
||||||
|
```
|
||||||
|
|
||||||
|
Puede entrar y salir de la pantalla completa con la combinación <kbd>MOD</kbd>+<kbd>f</kbd>.
|
||||||
|
|
||||||
|
#### Rotación
|
||||||
|
|
||||||
|
Se puede rotar la ventana:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --rotation 1
|
||||||
|
```
|
||||||
|
|
||||||
|
Los valores posibles son:
|
||||||
|
- `0`: sin rotación
|
||||||
|
- `1`: 90 grados contrarreloj
|
||||||
|
- `2`: 180 grados
|
||||||
|
- `3`: 90 grados en sentido de las agujas del reloj
|
||||||
|
|
||||||
|
La rotación también puede ser modificada con la combinación de teclas <kbd>MOD</kbd>+<kbd>←</kbd> _(izquierda)_ y <kbd>MOD</kbd>+<kbd>→</kbd> _(derecha)_.
|
||||||
|
|
||||||
|
Nótese que _scrcpy_ maneja 3 diferentes rotaciones:
|
||||||
|
- <kbd>MOD</kbd>+<kbd>r</kbd> solicita al dispositivo cambiar entre vertical y horizontal (la aplicación en uso puede rechazarlo si no soporta la orientación solicitada).
|
||||||
|
- [`--lock-video-orientation`](#fijar-la-rotación-del-video) cambia la rotación de la transmisión (la orientación del video enviado a la PC). Esto afecta a la grabación.
|
||||||
|
- `--rotation` (o <kbd>MOD</kbd>+<kbd>←</kbd>/<kbd>MOD</kbd>+<kbd>→</kbd>) rota solo el contenido de la imagen. Esto solo afecta a la imagen mostrada, no a la grabación.
|
||||||
|
|
||||||
|
|
||||||
|
### Otras opciones menores
|
||||||
|
|
||||||
|
#### Solo lectura ("Read-only")
|
||||||
|
|
||||||
|
Para deshabilitar los controles (todo lo que interactúe con el dispositivo: eventos del teclado, eventos del mouse, arrastrar y soltar archivos):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --no-control
|
||||||
|
scrcpy -n # versión breve
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Pantalla
|
||||||
|
|
||||||
|
Si múltiples pantallas están disponibles, es posible elegir cual transmitir:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --display 1
|
||||||
|
```
|
||||||
|
|
||||||
|
Los ids de las pantallas se pueden obtener con el siguiente comando:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb shell dumpsys display # busque "mDisplayId=" en la respuesta
|
||||||
|
```
|
||||||
|
|
||||||
|
La segunda pantalla solo puede ser manejada si el dispositivo cuenta con Android 10 (en caso contrario será transmitida en el modo solo lectura).
|
||||||
|
|
||||||
|
|
||||||
|
#### Permanecer activo
|
||||||
|
|
||||||
|
Para evitar que el dispositivo descanse después de un tiempo mientras está conectado:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --stay-awake
|
||||||
|
scrcpy -w # versión breve
|
||||||
|
```
|
||||||
|
|
||||||
|
La configuración original se restaura al cerrar scrcpy.
|
||||||
|
|
||||||
|
|
||||||
|
#### Apagar la pantalla
|
||||||
|
|
||||||
|
Es posible apagar la pantalla mientras se transmite al iniciar con el siguiente comando:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --turn-screen-off
|
||||||
|
scrcpy -S # versión breve
|
||||||
|
```
|
||||||
|
|
||||||
|
O presionando <kbd>MOD</kbd>+<kbd>o</kbd> en cualquier momento.
|
||||||
|
|
||||||
|
Para volver a prenderla, presione <kbd>MOD</kbd>+<kbd>Shift</kbd>+<kbd>o</kbd>.
|
||||||
|
|
||||||
|
En Android, el botón de `POWER` siempre prende la pantalla. Por conveniencia, si `POWER` es enviado vía scrcpy (con click-derecho o <kbd>MOD</kbd>+<kbd>p</kbd>), esto forzará a apagar la pantalla con un poco de atraso (en la mejor de las situaciones). El botón físico `POWER` seguirá prendiendo la pantalla.
|
||||||
|
|
||||||
|
También puede resultar útil para evitar que el dispositivo entre en inactividad:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --turn-screen-off --stay-awake
|
||||||
|
scrcpy -Sw # versión breve
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
#### Renderizar frames vencidos
|
||||||
|
|
||||||
|
Por defecto, para minimizar la latencia, _scrcpy_ siempre renderiza el último frame disponible decodificado, e ignora cualquier frame anterior.
|
||||||
|
|
||||||
|
Para forzar el renderizado de todos los frames (a costo de posible aumento de latencia), use:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --render-expired-frames
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Mostrar clicks
|
||||||
|
|
||||||
|
Para presentaciones, puede resultar útil mostrar los clicks físicos (en el dispositivo físicamente).
|
||||||
|
|
||||||
|
Android provee esta opción en _Opciones para desarrolladores_.
|
||||||
|
|
||||||
|
_Scrcpy_ provee una opción para habilitar esta función al iniciar la aplicación y restaurar el valor original al salir:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --show-touches
|
||||||
|
scrcpy -t # versión breve
|
||||||
|
```
|
||||||
|
|
||||||
|
Nótese que solo muestra los clicks _físicos_ (con el dedo en el dispositivo).
|
||||||
|
|
||||||
|
|
||||||
|
#### Desactivar protector de pantalla
|
||||||
|
|
||||||
|
Por defecto, scrcpy no evita que el protector de pantalla se active en la computadora.
|
||||||
|
|
||||||
|
Para deshabilitarlo:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --disable-screensaver
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Control
|
||||||
|
|
||||||
|
#### Rotar pantalla del dispositivo
|
||||||
|
|
||||||
|
Presione <kbd>MOD</kbd>+<kbd>r</kbd> para cambiar entre posición vertical y horizontal.
|
||||||
|
|
||||||
|
Nótese que solo rotará si la aplicación activa soporta la orientación solicitada.
|
||||||
|
|
||||||
|
#### Copiar y pegar
|
||||||
|
|
||||||
|
Cuando que el portapapeles de Android cambia, automáticamente se sincroniza al portapapeles de la computadora.
|
||||||
|
|
||||||
|
Cualquier shortcut con <kbd>Ctrl</kbd> es enviado al dispositivo. En particular:
|
||||||
|
- <kbd>Ctrl</kbd>+<kbd>c</kbd> normalmente copia
|
||||||
|
- <kbd>Ctrl</kbd>+<kbd>x</kbd> normalmente corta
|
||||||
|
- <kbd>Ctrl</kbd>+<kbd>v</kbd> normalmente pega (después de la sincronización de portapapeles entre la computadora y el dispositivo)
|
||||||
|
|
||||||
|
Esto normalmente funciona como es esperado.
|
||||||
|
|
||||||
|
Sin embargo, este comportamiento depende de la aplicación en uso. Por ejemplo, _Termux_ envía SIGINT con <kbd>Ctrl</kbd>+<kbd>c</kbd>, y _K-9 Mail_ crea un nuevo mensaje.
|
||||||
|
|
||||||
|
Para copiar, cortar y pegar, en tales casos (solo soportado en Android >= 7):
|
||||||
|
- <kbd>MOD</kbd>+<kbd>c</kbd> inyecta `COPY`
|
||||||
|
- <kbd>MOD</kbd>+<kbd>x</kbd> inyecta `CUT`
|
||||||
|
- <kbd>MOD</kbd>+<kbd>v</kbd> inyecta `PASTE` (después de la sincronización de portapapeles entre la computadora y el dispositivo)
|
||||||
|
|
||||||
|
Además, <kbd>MOD</kbd>+<kbd>Shift</kbd>+<kbd>v</kbd> permite inyectar el texto en el portapapeles de la computadora como una secuencia de teclas. Esto es útil cuando el componente no acepta pegado de texto (por ejemplo en _Termux_), pero puede romper caracteres no pertenecientes a ASCII.
|
||||||
|
|
||||||
|
**AVISO:** Pegar de la computadora al dispositivo (tanto con <kbd>Ctrl</kbd>+<kbd>v</kbd> o <kbd>MOD</kbd>+<kbd>v</kbd>) copia el contenido al portapapeles del dispositivo. Como consecuencia, cualquier aplicación de Android puede leer su contenido. Debería evitar pegar contenido sensible (como contraseñas) de esta forma.
|
||||||
|
|
||||||
|
Algunos dispositivos no se comportan como es esperado al establecer el portapapeles programáticamente. La opción `--legacy-paste` está disponible para cambiar el comportamiento de <kbd>Ctrl</kbd>+<kbd>v</kbd> y <kbd>MOD</kbd>+<kbd>v</kbd> para que también inyecten el texto del portapapeles de la computadora como una secuencia de teclas (de la misma forma que <kbd>MOD</kbd>+<kbd>Shift</kbd>+<kbd>v</kbd>).
|
||||||
|
|
||||||
|
#### Pellizcar para zoom
|
||||||
|
|
||||||
|
Para simular "pinch-to-zoom": <kbd>Ctrl</kbd>+_click-y-mover_.
|
||||||
|
|
||||||
|
Más precisamente, mantén <kbd>Ctrl</kbd> mientras presionas botón izquierdo. Hasta que no se suelte el botón, todos los movimientos del mouse cambiarán el tamaño y rotación del contenido (si es soportado por la app en uso) respecto al centro de la pantalla.
|
||||||
|
|
||||||
|
Concretamente, scrcpy genera clicks adicionales con un "dedo virtual" en la posición invertida respecto al centro de la pantalla.
|
||||||
|
|
||||||
|
|
||||||
|
#### Preferencias de inyección de texto
|
||||||
|
|
||||||
|
Existen dos tipos de [eventos][textevents] generados al escribir texto:
|
||||||
|
- _key events_, marcando si la tecla es presionada o soltada;
|
||||||
|
- _text events_, marcando si un texto fue introducido.
|
||||||
|
|
||||||
|
Por defecto, las letras son inyectadas usando _key events_, para que el teclado funcione como es esperado en juegos (típicamente las teclas WASD).
|
||||||
|
|
||||||
|
Pero esto puede [causar problemas][prefertext]. Si encuentras tales problemas, los puedes evitar con:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --prefer-text
|
||||||
|
```
|
||||||
|
|
||||||
|
(Pero esto romperá el comportamiento del teclado en los juegos)
|
||||||
|
|
||||||
|
[textevents]: https://blog.rom1v.com/2018/03/introducing-scrcpy/#handle-text-input
|
||||||
|
[prefertext]: https://github.com/Genymobile/scrcpy/issues/650#issuecomment-512945343
|
||||||
|
|
||||||
|
|
||||||
|
#### Repetir tecla
|
||||||
|
|
||||||
|
Por defecto, mantener una tecla presionada genera múltiples _key events_. Esto puede causar problemas de desempeño en algunos juegos, donde estos eventos no tienen sentido de todos modos.
|
||||||
|
|
||||||
|
Para evitar enviar _key events_ repetidos:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --no-key-repeat
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
#### Botón derecho y botón del medio
|
||||||
|
|
||||||
|
Por defecto, botón derecho ejecuta RETROCEDER (o ENCENDIDO) y botón del medio INICIO. Para inhabilitar estos atajos y enviar los clicks al dispositivo:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --forward-all-clicks
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Arrastrar y soltar archivos
|
||||||
|
|
||||||
|
#### Instalar APKs
|
||||||
|
|
||||||
|
Para instalar un APK, arrastre y suelte el archivo APK (terminado en `.apk`) a la ventana de _scrcpy_.
|
||||||
|
|
||||||
|
No hay respuesta visual, un mensaje se escribirá en la consola.
|
||||||
|
|
||||||
|
|
||||||
|
#### Enviar archivos al dispositivo
|
||||||
|
|
||||||
|
Para enviar un archivo a `/sdcard/` en el dispositivo, arrastre y suelte un archivo (no APK) a la ventana de _scrcpy_.
|
||||||
|
|
||||||
|
No hay respuesta visual, un mensaje se escribirá en la consola.
|
||||||
|
|
||||||
|
El directorio de destino puede ser modificado al iniciar:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --push-target=/sdcard/Download/
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Envío de Audio
|
||||||
|
|
||||||
|
_Scrcpy_ no envía el audio. Use [sndcpy].
|
||||||
|
|
||||||
|
También lea [issue #14].
|
||||||
|
|
||||||
|
[sndcpy]: https://github.com/rom1v/sndcpy
|
||||||
|
[issue #14]: https://github.com/Genymobile/scrcpy/issues/14
|
||||||
|
|
||||||
|
|
||||||
|
## Atajos
|
||||||
|
|
||||||
|
En la siguiente lista, <kbd>MOD</kbd> es el atajo modificador. Por defecto es <kbd>Alt</kbd> (izquierdo) o <kbd>Super</kbd> (izquierdo).
|
||||||
|
|
||||||
|
Se puede modificar usando `--shortcut-mod`. Las posibles teclas son `lctrl` (izquierdo), `rctrl` (derecho), `lalt` (izquierdo), `ralt` (derecho), `lsuper` (izquierdo) y `rsuper` (derecho). Por ejemplo:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# use RCtrl para los atajos
|
||||||
|
scrcpy --shortcut-mod=rctrl
|
||||||
|
|
||||||
|
# use tanto LCtrl+LAlt o LSuper para los atajos
|
||||||
|
scrcpy --shortcut-mod=lctrl+lalt,lsuper
|
||||||
|
```
|
||||||
|
|
||||||
|
_<kbd>[Super]</kbd> es generalmente la tecla <kbd>Windows</kbd> o <kbd>Cmd</kbd>._
|
||||||
|
|
||||||
|
[Super]: https://en.wikipedia.org/wiki/Super_key_(keyboard_button)
|
||||||
|
|
||||||
|
| Acción | Atajo
|
||||||
|
| ------------------------------------------- |:-----------------------------
|
||||||
|
| Alterne entre pantalla compelta | <kbd>MOD</kbd>+<kbd>f</kbd>
|
||||||
|
| Rotar pantalla hacia la izquierda | <kbd>MOD</kbd>+<kbd>←</kbd> _(izquierda)_
|
||||||
|
| Rotar pantalla hacia la derecha | <kbd>MOD</kbd>+<kbd>→</kbd> _(derecha)_
|
||||||
|
| Ajustar ventana a 1:1 ("pixel-perfect") | <kbd>MOD</kbd>+<kbd>g</kbd>
|
||||||
|
| Ajustar ventana para quitar los bordes negros| <kbd>MOD</kbd>+<kbd>w</kbd> \| _Doble click¹_
|
||||||
|
| Click en `INICIO` | <kbd>MOD</kbd>+<kbd>h</kbd> \| _Botón del medio_
|
||||||
|
| Click en `RETROCEDER` | <kbd>MOD</kbd>+<kbd>b</kbd> \| _Botón derecho²_
|
||||||
|
| Click en `CAMBIAR APLICACIÓN` | <kbd>MOD</kbd>+<kbd>s</kbd>
|
||||||
|
| Click en `MENÚ` (desbloquear pantalla) | <kbd>MOD</kbd>+<kbd>m</kbd>
|
||||||
|
| Click en `SUBIR VOLUMEN` | <kbd>MOD</kbd>+<kbd>↑</kbd> _(arriba)_
|
||||||
|
| Click en `BAJAR VOLUME` | <kbd>MOD</kbd>+<kbd>↓</kbd> _(abajo)_
|
||||||
|
| Click en `ENCENDIDO` | <kbd>MOD</kbd>+<kbd>p</kbd>
|
||||||
|
| Encendido | _Botón derecho²_
|
||||||
|
| Apagar pantalla (manteniendo la transmisión)| <kbd>MOD</kbd>+<kbd>o</kbd>
|
||||||
|
| Encender pantalla | <kbd>MOD</kbd>+<kbd>Shift</kbd>+<kbd>o</kbd>
|
||||||
|
| Rotar pantalla del dispositivo | <kbd>MOD</kbd>+<kbd>r</kbd>
|
||||||
|
| Abrir panel de notificaciones | <kbd>MOD</kbd>+<kbd>n</kbd>
|
||||||
|
| Cerrar panel de notificaciones | <kbd>MOD</kbd>+<kbd>Shift</kbd>+<kbd>n</kbd>
|
||||||
|
| Copiar al portapapeles³ | <kbd>MOD</kbd>+<kbd>c</kbd>
|
||||||
|
| Cortar al portapapeles³ | <kbd>MOD</kbd>+<kbd>x</kbd>
|
||||||
|
| Synchronizar portapapeles y pegar³ | <kbd>MOD</kbd>+<kbd>v</kbd>
|
||||||
|
| inyectar texto del portapapeles de la PC | <kbd>MOD</kbd>+<kbd>Shift</kbd>+<kbd>v</kbd>
|
||||||
|
| Habilitar/Deshabilitar contador de FPS (en stdout) | <kbd>MOD</kbd>+<kbd>i</kbd>
|
||||||
|
| Pellizcar para zoom | <kbd>Ctrl</kbd>+_click-y-mover_
|
||||||
|
|
||||||
|
_¹Doble click en los bordes negros para eliminarlos._
|
||||||
|
_²Botón derecho enciende la pantalla si estaba apagada, sino ejecuta RETROCEDER._
|
||||||
|
_³Solo en Android >= 7._
|
||||||
|
|
||||||
|
Todos los atajos <kbd>Ctrl</kbd>+_tecla_ son enviados al dispositivo para que sean manejados por la aplicación activa.
|
||||||
|
|
||||||
|
|
||||||
|
## Path personalizado
|
||||||
|
|
||||||
|
Para usar un binario de _adb_ en particular, configure el path `ADB` en las variables de entorno:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ADB=/path/to/adb scrcpy
|
||||||
|
```
|
||||||
|
|
||||||
|
Para sobreescribir el path del archivo `scrcpy-server`, configure el path en `SCRCPY_SERVER_PATH`.
|
||||||
|
|
||||||
|
|
||||||
|
## ¿Por qué _scrcpy_?
|
||||||
|
|
||||||
|
Un colega me retó a encontrar un nombre tan impronunciable como [gnirehtet].
|
||||||
|
|
||||||
|
[`strcpy`] copia un **str**ing; `scrcpy` copia un **scr**een.
|
||||||
|
|
||||||
|
[gnirehtet]: https://github.com/Genymobile/gnirehtet
|
||||||
|
[`strcpy`]: http://man7.org/linux/man-pages/man3/strcpy.3.html
|
||||||
|
|
||||||
|
|
||||||
|
## ¿Cómo construir (BUILD)?
|
||||||
|
|
||||||
|
Véase [BUILD] (en inglés).
|
||||||
|
|
||||||
|
|
||||||
|
## Problemas generales
|
||||||
|
|
||||||
|
Vea las [preguntas frecuentes (en inglés)](FAQ.md).
|
||||||
|
|
||||||
|
|
||||||
|
## Desarrolladores
|
||||||
|
|
||||||
|
Lea la [hoja de desarrolladores (en inglés)](DEVELOP.md).
|
||||||
|
|
||||||
|
|
||||||
|
## Licencia
|
||||||
|
|
||||||
|
Copyright (C) 2018 Genymobile
|
||||||
|
Copyright (C) 2018-2021 Romain Vimont
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
## Artículos
|
||||||
|
|
||||||
|
- [Introducing scrcpy][article-intro] (en inglés)
|
||||||
|
- [Scrcpy now works wirelessly][article-tcpip] (en inglés)
|
||||||
|
|
||||||
|
[article-intro]: https://blog.rom1v.com/2018/03/introducing-scrcpy/
|
||||||
|
[article-tcpip]: https://www.genymotion.com/blog/open-source-project-scrcpy-now-works-wirelessly/
|
824
README.tr.md
Normal file
824
README.tr.md
Normal file
@ -0,0 +1,824 @@
|
|||||||
|
# scrcpy (v1.18)
|
||||||
|
|
||||||
|
Bu uygulama Android cihazların USB (ya da [TCP/IP][article-tcpip]) üzerinden
|
||||||
|
görüntülenmesini ve kontrol edilmesini sağlar. _root_ erişimine ihtiyaç duymaz.
|
||||||
|
_GNU/Linux_, _Windows_ ve _macOS_ sistemlerinde çalışabilir.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Öne çıkan özellikler:
|
||||||
|
|
||||||
|
- **hafiflik** (doğal, sadece cihazın ekranını gösterir)
|
||||||
|
- **performans** (30~60fps)
|
||||||
|
- **kalite** (1920×1080 ya da üzeri)
|
||||||
|
- **düşük gecikme süresi** ([35~70ms][lowlatency])
|
||||||
|
- **düşük başlangıç süresi** (~1 saniye ilk kareyi gösterme süresi)
|
||||||
|
- **müdaheleci olmama** (cihazda kurulu yazılım kalmaz)
|
||||||
|
|
||||||
|
[lowlatency]: https://github.com/Genymobile/scrcpy/pull/646
|
||||||
|
|
||||||
|
## Gereksinimler
|
||||||
|
|
||||||
|
Android cihaz en düşük API 21 (Android 5.0) olmalıdır.
|
||||||
|
|
||||||
|
[Adb hata ayıklamasının][enable-adb] cihazınızda aktif olduğundan emin olun.
|
||||||
|
|
||||||
|
[enable-adb]: https://developer.android.com/studio/command-line/adb.html#Enabling
|
||||||
|
|
||||||
|
Bazı cihazlarda klavye ve fare ile kontrol için [ilave bir seçenek][control] daha
|
||||||
|
etkinleştirmeniz gerekebilir.
|
||||||
|
|
||||||
|
[control]: https://github.com/Genymobile/scrcpy/issues/70#issuecomment-373286323
|
||||||
|
|
||||||
|
## Uygulamayı indirin
|
||||||
|
|
||||||
|
<a href="https://repology.org/project/scrcpy/versions"><img src="https://repology.org/badge/vertical-allrepos/scrcpy.svg" alt="Packaging status" align="right"></a>
|
||||||
|
|
||||||
|
### Özet
|
||||||
|
|
||||||
|
- Linux: `apt install scrcpy`
|
||||||
|
- Windows: [indir][direct-win64]
|
||||||
|
- macOS: `brew install scrcpy`
|
||||||
|
|
||||||
|
Kaynak kodu derle: [BUILD] ([basitleştirilmiş süreç][build_simple])
|
||||||
|
|
||||||
|
[build]: BUILD.md
|
||||||
|
[build_simple]: BUILD.md#simple
|
||||||
|
|
||||||
|
### Linux
|
||||||
|
|
||||||
|
Debian (şimdilik _testing_ ve _sid_) ve Ubuntu (20.04) için:
|
||||||
|
|
||||||
|
```
|
||||||
|
apt install scrcpy
|
||||||
|
```
|
||||||
|
|
||||||
|
[Snap] paketi: [`scrcpy`][snap-link].
|
||||||
|
|
||||||
|
[snap-link]: https://snapstats.org/snaps/scrcpy
|
||||||
|
[snap]: https://en.wikipedia.org/wiki/Snappy_(package_manager)
|
||||||
|
|
||||||
|
Fedora için, [COPR] paketi: [`scrcpy`][copr-link].
|
||||||
|
|
||||||
|
[copr]: https://fedoraproject.org/wiki/Category:Copr
|
||||||
|
[copr-link]: https://copr.fedorainfracloud.org/coprs/zeno/scrcpy/
|
||||||
|
|
||||||
|
Arch Linux için, [AUR] paketi: [`scrcpy`][aur-link].
|
||||||
|
|
||||||
|
[aur]: https://wiki.archlinux.org/index.php/Arch_User_Repository
|
||||||
|
[aur-link]: https://aur.archlinux.org/packages/scrcpy/
|
||||||
|
|
||||||
|
Gentoo için, [Ebuild] mevcut: [`scrcpy/`][ebuild-link].
|
||||||
|
|
||||||
|
[ebuild]: https://wiki.gentoo.org/wiki/Ebuild
|
||||||
|
[ebuild-link]: https://github.com/maggu2810/maggu2810-overlay/tree/master/app-mobilephone/scrcpy
|
||||||
|
|
||||||
|
Ayrıca [uygulamayı el ile de derleyebilirsiniz][build] ([basitleştirilmiş süreç][build_simple]).
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
Windows için (`adb` dahil) tüm gereksinimleri ile derlenmiş bir arşiv mevcut:
|
||||||
|
|
||||||
|
- [README](README.md#windows)
|
||||||
|
|
||||||
|
[Chocolatey] ile kurulum:
|
||||||
|
|
||||||
|
[chocolatey]: https://chocolatey.org/
|
||||||
|
|
||||||
|
```bash
|
||||||
|
choco install scrcpy
|
||||||
|
choco install adb # if you don't have it yet
|
||||||
|
```
|
||||||
|
|
||||||
|
[Scoop] ile kurulum:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scoop install scrcpy
|
||||||
|
scoop install adb # if you don't have it yet
|
||||||
|
```
|
||||||
|
|
||||||
|
[scoop]: https://scoop.sh
|
||||||
|
|
||||||
|
Ayrıca [uygulamayı el ile de derleyebilirsiniz][build].
|
||||||
|
|
||||||
|
### macOS
|
||||||
|
|
||||||
|
Uygulama [Homebrew] içerisinde mevcut. Sadece kurun:
|
||||||
|
|
||||||
|
[homebrew]: https://brew.sh/
|
||||||
|
|
||||||
|
```bash
|
||||||
|
brew install scrcpy
|
||||||
|
```
|
||||||
|
|
||||||
|
`adb`, `PATH` içerisinden erişilebilir olmalıdır. Eğer değilse:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
brew install android-platform-tools
|
||||||
|
```
|
||||||
|
|
||||||
|
[MacPorts] kullanılarak adb ve uygulamanın birlikte kurulumu yapılabilir:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo port install scrcpy
|
||||||
|
```
|
||||||
|
|
||||||
|
[macports]: https://www.macports.org/
|
||||||
|
|
||||||
|
Ayrıca [uygulamayı el ile de derleyebilirsiniz][build].
|
||||||
|
|
||||||
|
## Çalıştırma
|
||||||
|
|
||||||
|
Android cihazınızı bağlayın ve aşağıdaki komutu çalıştırın:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy
|
||||||
|
```
|
||||||
|
|
||||||
|
Komut satırı argümanları aşağıdaki komut ile listelenebilir:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --help
|
||||||
|
```
|
||||||
|
|
||||||
|
## Özellikler
|
||||||
|
|
||||||
|
### Ekran yakalama ayarları
|
||||||
|
|
||||||
|
#### Boyut azaltma
|
||||||
|
|
||||||
|
Bazen, Android cihaz ekranını daha düşük seviyede göstermek performansı artırabilir.
|
||||||
|
|
||||||
|
Hem genişliği hem de yüksekliği bir değere sabitlemek için (ör. 1024):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --max-size 1024
|
||||||
|
scrcpy -m 1024 # kısa versiyon
|
||||||
|
```
|
||||||
|
|
||||||
|
Diğer boyut en-boy oranı korunacak şekilde hesaplanır.
|
||||||
|
Bu şekilde ekran boyutu 1920x1080 olan bir cihaz 1024x576 olarak görünür.
|
||||||
|
|
||||||
|
#### Bit-oranı değiştirme
|
||||||
|
|
||||||
|
Varsayılan bit-oranı 8 Mbps'dir. Değiştirmek için (ör. 2 Mbps):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --bit-rate 2M
|
||||||
|
scrcpy -b 2M # kısa versiyon
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Çerçeve oranı sınırlama
|
||||||
|
|
||||||
|
Ekran yakalama için maksimum çerçeve oranı için sınır koyulabilir:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --max-fps 15
|
||||||
|
```
|
||||||
|
|
||||||
|
Bu özellik Android 10 ve sonrası sürümlerde resmi olarak desteklenmektedir,
|
||||||
|
ancak daha önceki sürümlerde çalışmayabilir.
|
||||||
|
|
||||||
|
#### Kesme
|
||||||
|
|
||||||
|
Cihaz ekranının sadece bir kısmı görünecek şekilde kesilebilir.
|
||||||
|
|
||||||
|
Bu özellik Oculus Go'nun bir gözünü yakalamak gibi durumlarda kullanışlı olur:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --crop 1224:1440:0:0 # (0,0) noktasından 1224x1440
|
||||||
|
```
|
||||||
|
|
||||||
|
Eğer `--max-size` belirtilmişse yeniden boyutlandırma kesme işleminden sonra yapılır.
|
||||||
|
|
||||||
|
#### Video yönünü kilitleme
|
||||||
|
|
||||||
|
Videonun yönünü kilitlemek için:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --lock-video-orientation # başlangıç yönü
|
||||||
|
scrcpy --lock-video-orientation=0 # doğal yön
|
||||||
|
scrcpy --lock-video-orientation=1 # 90° saatin tersi yönü
|
||||||
|
scrcpy --lock-video-orientation=2 # 180°
|
||||||
|
scrcpy --lock-video-orientation=3 # 90° saat yönü
|
||||||
|
```
|
||||||
|
|
||||||
|
Bu özellik kaydetme yönünü de etkiler.
|
||||||
|
|
||||||
|
[Pencere ayrı olarak döndürülmüş](#rotation) olabilir.
|
||||||
|
|
||||||
|
#### Kodlayıcı
|
||||||
|
|
||||||
|
Bazı cihazlar birden fazla kodlayıcıya sahiptir, ve bunların bazıları programın
|
||||||
|
kapanmasına sebep olabilir. Bu durumda farklı bir kodlayıcı seçilebilir:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --encoder OMX.qcom.video.encoder.avc
|
||||||
|
```
|
||||||
|
|
||||||
|
Mevcut kodlayıcıları listelemek için geçerli olmayan bir kodlayıcı ismi girebilirsiniz,
|
||||||
|
hata mesajı mevcut kodlayıcıları listeleyecektir:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --encoder _
|
||||||
|
```
|
||||||
|
|
||||||
|
### Yakalama
|
||||||
|
|
||||||
|
#### Kaydetme
|
||||||
|
|
||||||
|
Ekran yakalama sırasında kaydedilebilir:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --record file.mp4
|
||||||
|
scrcpy -r file.mkv
|
||||||
|
```
|
||||||
|
|
||||||
|
Yakalama olmadan kayıt için:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --no-display --record file.mp4
|
||||||
|
scrcpy -Nr file.mkv
|
||||||
|
# Ctrl+C ile kayıt kesilebilir
|
||||||
|
```
|
||||||
|
|
||||||
|
"Atlanan kareler" gerçek zamanlı olarak gösterilmese (performans sebeplerinden ötürü) dahi kaydedilir.
|
||||||
|
Kareler cihazda _zamandamgası_ ile saklanır, bu sayede [paket gecikme varyasyonu]
|
||||||
|
kayıt edilen dosyayı etkilemez.
|
||||||
|
|
||||||
|
[paket gecikme varyasyonu]: https://en.wikipedia.org/wiki/Packet_delay_variation
|
||||||
|
|
||||||
|
#### v4l2loopback
|
||||||
|
|
||||||
|
Linux'ta video akışı bir v4l2 loopback cihazına gönderilebilir. Bu sayede Android
|
||||||
|
cihaz bir web kamerası gibi davranabilir.
|
||||||
|
|
||||||
|
Bu işlem için `v4l2loopback` modülü kurulu olmalıdır:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install v4l2loopback-dkms
|
||||||
|
```
|
||||||
|
|
||||||
|
v4l2 cihazı oluşturmak için:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo modprobe v4l2loopback
|
||||||
|
```
|
||||||
|
|
||||||
|
Bu komut `/dev/videoN` adresinde `N` yerine bir tamsayı koyarak yeni bir video
|
||||||
|
cihazı oluşturacaktır.
|
||||||
|
(birden fazla cihaz oluşturmak veya spesifik ID'ye sahip cihazlar için
|
||||||
|
diğer [seçenekleri](https://github.com/umlaeute/v4l2loopback#options) inceleyebilirsiniz.)
|
||||||
|
|
||||||
|
Aktif cihazları listelemek için:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# v4l-utils paketi ile
|
||||||
|
v4l2-ctl --list-devices
|
||||||
|
|
||||||
|
# daha basit ama yeterli olabilecek şekilde
|
||||||
|
ls /dev/video*
|
||||||
|
```
|
||||||
|
|
||||||
|
v4l2 kullanarak scrpy kullanmaya başlamak için:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --v4l2-sink=/dev/videoN
|
||||||
|
scrcpy --v4l2-sink=/dev/videoN --no-display # ayna penceresini kapatarak
|
||||||
|
scrcpy --v4l2-sink=/dev/videoN -N # kısa versiyon
|
||||||
|
```
|
||||||
|
|
||||||
|
(`N` harfini oluşturulan cihaz ID numarası ile değiştirin. `ls /dev/video*` cihaz ID'lerini görebilirsiniz.)
|
||||||
|
|
||||||
|
Aktifleştirildikten sonra video akışını herhangi bir v4l2 özellikli araçla açabilirsiniz:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ffplay -i /dev/videoN
|
||||||
|
vlc v4l2:///dev/videoN # VLC kullanırken yükleme gecikmesi olabilir
|
||||||
|
```
|
||||||
|
|
||||||
|
Örneğin, [OBS] ile video akışını kullanabilirsiniz.
|
||||||
|
|
||||||
|
[obs]: https://obsproject.com/
|
||||||
|
|
||||||
|
### Bağlantı
|
||||||
|
|
||||||
|
#### Kablosuz
|
||||||
|
|
||||||
|
_Scrcpy_ cihazla iletişim kurmak için `adb`'yi kullanır, Ve `adb`
|
||||||
|
bir cihaza TCP/IP kullanarak [bağlanabilir].
|
||||||
|
|
||||||
|
1. Cihazınızı bilgisayarınızla aynı Wi-Fi ağına bağlayın.
|
||||||
|
2. Cihazınızın IP adresini bulun. Ayarlar → Telefon Hakkında → Durum sekmesinden veya
|
||||||
|
aşağıdaki komutu çalıştırarak öğrenebilirsiniz:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb shell ip route | awk '{print $9}'
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Cihazınızda TCP/IP üzerinden adb kullanımını etkinleştirin: `adb tcpip 5555`.
|
||||||
|
4. Cihazınızı bilgisayarınızdan sökün.
|
||||||
|
5. Cihazınıza bağlanın: `adb connect DEVICE_IP:5555` _(`DEVICE_IP` değerini değiştirin)_.
|
||||||
|
6. `scrcpy` komutunu normal olarak çalıştırın.
|
||||||
|
|
||||||
|
Bit-oranını ve büyüklüğü azaltmak yararlı olabilir:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --bit-rate 2M --max-size 800
|
||||||
|
scrcpy -b2M -m800 # kısa version
|
||||||
|
```
|
||||||
|
|
||||||
|
[bağlanabilir]: https://developer.android.com/studio/command-line/adb.html#wireless
|
||||||
|
|
||||||
|
#### Birden fazla cihaz
|
||||||
|
|
||||||
|
Eğer `adb devices` komutu birden fazla cihaz listeliyorsa _serial_ değerini belirtmeniz gerekir:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --serial 0123456789abcdef
|
||||||
|
scrcpy -s 0123456789abcdef # kısa versiyon
|
||||||
|
```
|
||||||
|
|
||||||
|
Eğer cihaz TCP/IP üzerinden bağlanmışsa:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --serial 192.168.0.1:5555
|
||||||
|
scrcpy -s 192.168.0.1:5555 # kısa version
|
||||||
|
```
|
||||||
|
|
||||||
|
Birden fazla cihaz için birden fazla _scrcpy_ uygulaması çalıştırabilirsiniz.
|
||||||
|
|
||||||
|
#### Cihaz bağlantısı ile otomatik başlatma
|
||||||
|
|
||||||
|
[AutoAdb] ile yapılabilir:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
autoadb scrcpy -s '{}'
|
||||||
|
```
|
||||||
|
|
||||||
|
[autoadb]: https://github.com/rom1v/autoadb
|
||||||
|
|
||||||
|
#### SSH Tünel
|
||||||
|
|
||||||
|
Uzaktaki bir cihaza erişmek için lokal `adb` istemcisi, uzaktaki bir `adb` sunucusuna
|
||||||
|
(aynı _adb_ sürümünü kullanmak şartı ile) bağlanabilir :
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb kill-server # 5037 portunda çalışan lokal adb sunucusunu kapat
|
||||||
|
ssh -CN -L5037:localhost:5037 -R27183:localhost:27183 your_remote_computer
|
||||||
|
# bunu açık tutun
|
||||||
|
```
|
||||||
|
|
||||||
|
Başka bir terminalde:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy
|
||||||
|
```
|
||||||
|
|
||||||
|
Uzaktan port yönlendirme ileri yönlü bağlantı kullanabilirsiniz
|
||||||
|
(`-R` yerine `-L` olduğuna dikkat edin):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb kill-server # 5037 portunda çalışan lokal adb sunucusunu kapat
|
||||||
|
ssh -CN -L5037:localhost:5037 -L27183:localhost:27183 your_remote_computer
|
||||||
|
# bunu açık tutun
|
||||||
|
```
|
||||||
|
|
||||||
|
Başka bir terminalde:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --force-adb-forward
|
||||||
|
```
|
||||||
|
|
||||||
|
Kablosuz bağlantı gibi burada da kalite düşürmek faydalı olabilir:
|
||||||
|
|
||||||
|
```
|
||||||
|
scrcpy -b2M -m800 --max-fps 15
|
||||||
|
```
|
||||||
|
|
||||||
|
### Pencere ayarları
|
||||||
|
|
||||||
|
#### İsim
|
||||||
|
|
||||||
|
Cihaz modeli varsayılan pencere ismidir. Değiştirmek için:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --window-title 'Benim cihazım'
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Konum ve
|
||||||
|
|
||||||
|
Pencerenin başlangıç konumu ve boyutu belirtilebilir:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --window-x 100 --window-y 100 --window-width 800 --window-height 600
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Kenarlıklar
|
||||||
|
|
||||||
|
Pencere dekorasyonunu kapatmak için:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --window-borderless
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Her zaman üstte
|
||||||
|
|
||||||
|
Scrcpy penceresini her zaman üstte tutmak için:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --always-on-top
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Tam ekran
|
||||||
|
|
||||||
|
Uygulamayı tam ekran başlatmak için:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --fullscreen
|
||||||
|
scrcpy -f # kısa versiyon
|
||||||
|
```
|
||||||
|
|
||||||
|
Tam ekran <kbd>MOD</kbd>+<kbd>f</kbd> ile dinamik olarak değiştirilebilir.
|
||||||
|
|
||||||
|
#### Döndürme
|
||||||
|
|
||||||
|
Pencere döndürülebilir:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --rotation 1
|
||||||
|
```
|
||||||
|
|
||||||
|
Seçilebilecek değerler:
|
||||||
|
|
||||||
|
- `0`: döndürme yok
|
||||||
|
- `1`: 90 derece saat yönünün tersi
|
||||||
|
- `2`: 180 derece
|
||||||
|
- `3`: 90 derece saat yönü
|
||||||
|
|
||||||
|
Döndürme <kbd>MOD</kbd>+<kbd>←</kbd>_(sol)_ ve
|
||||||
|
<kbd>MOD</kbd>+<kbd>→</kbd> _(sağ)_ ile dinamik olarak değiştirilebilir.
|
||||||
|
|
||||||
|
_scrcpy_'de 3 farklı döndürme olduğuna dikkat edin:
|
||||||
|
|
||||||
|
- <kbd>MOD</kbd>+<kbd>r</kbd> cihazın yatay veya dikey modda çalışmasını sağlar.
|
||||||
|
(çalışan uygulama istenilen oryantasyonda çalışmayı desteklemiyorsa döndürme
|
||||||
|
işlemini reddedebilir.)
|
||||||
|
- [`--lock-video-orientation`](#lock-video-orientation) görüntü yakalama oryantasyonunu
|
||||||
|
(cihazdan bilgisayara gelen video akışının oryantasyonu) değiştirir. Bu kayıt işlemini
|
||||||
|
etkiler.
|
||||||
|
- `--rotation` (or <kbd>MOD</kbd>+<kbd>←</kbd>/<kbd>MOD</kbd>+<kbd>→</kbd>)
|
||||||
|
pencere içeriğini dönderir. Bu sadece canlı görüntüyü etkiler, kayıt işlemini etkilemez.
|
||||||
|
|
||||||
|
### Diğer ekran yakalama seçenekleri
|
||||||
|
|
||||||
|
#### Yazma korumalı
|
||||||
|
|
||||||
|
Kontrolleri devre dışı bırakmak için (cihazla etkileşime geçebilecek her şey: klavye ve
|
||||||
|
fare girdileri, dosya sürükleyip bırakma):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --no-control
|
||||||
|
scrcpy -n
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Ekran
|
||||||
|
|
||||||
|
Eğer cihazın birden fazla ekranı varsa hangi ekranın kullanılacağını seçebilirsiniz:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --display 1
|
||||||
|
```
|
||||||
|
|
||||||
|
Kullanılabilecek ekranları listelemek için:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb shell dumpsys display # çıktı içerisinde "mDisplayId=" terimini arayın
|
||||||
|
```
|
||||||
|
|
||||||
|
İkinci ekran ancak cihaz Android sürümü 10 veya üzeri olmalıdır (değilse yazma korumalı
|
||||||
|
olarak görüntülenir).
|
||||||
|
|
||||||
|
#### Uyanık kalma
|
||||||
|
|
||||||
|
Cihazın uyku moduna girmesini engellemek için:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --stay-awake
|
||||||
|
scrcpy -w
|
||||||
|
```
|
||||||
|
|
||||||
|
scrcpy kapandığında cihaz başlangıç durumuna geri döner.
|
||||||
|
|
||||||
|
#### Ekranı kapatma
|
||||||
|
|
||||||
|
Ekran yakalama sırasında cihazın ekranı kapatılabilir:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --turn-screen-off
|
||||||
|
scrcpy -S
|
||||||
|
```
|
||||||
|
|
||||||
|
Ya da <kbd>MOD</kbd>+<kbd>o</kbd> kısayolunu kullanabilirsiniz.
|
||||||
|
|
||||||
|
Tekrar açmak için ise <kbd>MOD</kbd>+<kbd>Shift</kbd>+<kbd>o</kbd> tuşlarına basın.
|
||||||
|
|
||||||
|
Android'de, `GÜÇ` tuşu her zaman ekranı açar. Eğer `GÜÇ` sinyali scrcpy ile
|
||||||
|
gönderilsiyse (sağ tık veya <kbd>MOD</kbd>+<kbd>p</kbd>), ekran kısa bir gecikme
|
||||||
|
ile kapanacaktır. Fiziksel `GÜÇ` tuşuna basmak hala ekranın açılmasına sebep olacaktır.
|
||||||
|
|
||||||
|
Bu cihazın uykuya geçmesini engellemek için kullanılabilir:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --turn-screen-off --stay-awake
|
||||||
|
scrcpy -Sw
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Dokunuşları gösterme
|
||||||
|
|
||||||
|
Sunumlar sırasında fiziksel dokunuşları (fiziksel cihazdaki) göstermek
|
||||||
|
faydalı olabilir.
|
||||||
|
|
||||||
|
Android'de bu özellik _Geliştici seçenekleri_ içerisinde bulunur.
|
||||||
|
|
||||||
|
_Scrcpy_ bu özelliği çalışırken etkinleştirebilir ve kapanırken eski
|
||||||
|
haline geri getirebilir:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --show-touches
|
||||||
|
scrcpy -t
|
||||||
|
```
|
||||||
|
|
||||||
|
Bu opsiyon sadece _fiziksel_ dokunuşları (cihaz ekranındaki) gösterir.
|
||||||
|
|
||||||
|
#### Ekran koruyucuyu devre dışı bırakma
|
||||||
|
|
||||||
|
Scrcpy varsayılan ayarlarında ekran koruyucuyu devre dışı bırakmaz.
|
||||||
|
|
||||||
|
Bırakmak için:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --disable-screensaver
|
||||||
|
```
|
||||||
|
|
||||||
|
### Girdi kontrolü
|
||||||
|
|
||||||
|
#### Cihaz ekranını dönderme
|
||||||
|
|
||||||
|
<kbd>MOD</kbd>+<kbd>r</kbd> tuşları ile yatay ve dikey modlar arasında
|
||||||
|
geçiş yapabilirsiniz.
|
||||||
|
|
||||||
|
Bu kısayol ancak çalışan uygulama desteklediği takdirde ekranı döndürecektir.
|
||||||
|
|
||||||
|
#### Kopyala yapıştır
|
||||||
|
|
||||||
|
Ne zaman Android cihazdaki pano değişse bilgisayardaki pano otomatik olarak
|
||||||
|
senkronize edilir.
|
||||||
|
|
||||||
|
Tüm <kbd>Ctrl</kbd> kısayolları cihaza iletilir:
|
||||||
|
|
||||||
|
- <kbd>Ctrl</kbd>+<kbd>c</kbd> genelde kopyalar
|
||||||
|
- <kbd>Ctrl</kbd>+<kbd>x</kbd> genelde keser
|
||||||
|
- <kbd>Ctrl</kbd>+<kbd>v</kbd> genelde yapıştırır (bilgisayar ve cihaz arasındaki
|
||||||
|
pano senkronizasyonundan sonra)
|
||||||
|
|
||||||
|
Bu kısayollar genelde beklediğiniz gibi çalışır.
|
||||||
|
|
||||||
|
Ancak kısayolun gerçekten yaptığı eylemi açık olan uygulama belirler.
|
||||||
|
Örneğin, _Termux_ <kbd>Ctrl</kbd>+<kbd>c</kbd> ile kopyalama yerine
|
||||||
|
SIGINT sinyali gönderir, _K-9 Mail_ ise yeni mesaj oluşturur.
|
||||||
|
|
||||||
|
Bu tip durumlarda kopyalama, kesme ve yapıştırma için (Android versiyon 7 ve
|
||||||
|
üstü):
|
||||||
|
|
||||||
|
- <kbd>MOD</kbd>+<kbd>c</kbd> `KOPYALA`
|
||||||
|
- <kbd>MOD</kbd>+<kbd>x</kbd> `KES`
|
||||||
|
- <kbd>MOD</kbd>+<kbd>v</kbd> `YAPIŞTIR` (bilgisayar ve cihaz arasındaki
|
||||||
|
pano senkronizasyonundan sonra)
|
||||||
|
|
||||||
|
Bunlara ek olarak, <kbd>MOD</kbd>+<kbd>Shift</kbd>+<kbd>v</kbd> tuşları
|
||||||
|
bilgisayar pano içeriğini tuş basma eylemleri şeklinde gönderir. Bu metin
|
||||||
|
yapıştırmayı desteklemeyen (_Termux_ gibi) uygulamar için kullanışlıdır,
|
||||||
|
ancak ASCII olmayan içerikleri bozabilir.
|
||||||
|
|
||||||
|
**UYARI:** Bilgisayar pano içeriğini cihaza yapıştırmak
|
||||||
|
(<kbd>Ctrl</kbd>+<kbd>v</kbd> ya da <kbd>MOD</kbd>+<kbd>v</kbd> tuşları ile)
|
||||||
|
içeriği cihaz panosuna kopyalar. Sonuç olarak, herhangi bir Android uygulaması
|
||||||
|
içeriğe erişebilir. Hassas içerikler (parolalar gibi) için bu özelliği kullanmaktan
|
||||||
|
kaçının.
|
||||||
|
|
||||||
|
Bazı cihazlar pano değişikleri konusunda beklenilen şekilde çalışmayabilir.
|
||||||
|
Bu durumlarda `--legacy-paste` argümanı kullanılabilir. Bu sayede
|
||||||
|
<kbd>Ctrl</kbd>+<kbd>v</kbd> ve <kbd>MOD</kbd>+<kbd>v</kbd> tuşları da
|
||||||
|
pano içeriğini tuş basma eylemleri şeklinde gönderir
|
||||||
|
(<kbd>MOD</kbd>+<kbd>Shift</kbd>+<kbd>v</kbd> ile aynı şekilde).
|
||||||
|
|
||||||
|
#### İki parmak ile yakınlaştırma
|
||||||
|
|
||||||
|
"İki parmak ile yakınlaştırma" için: <kbd>Ctrl</kbd>+_tıkla-ve-sürükle_.
|
||||||
|
|
||||||
|
Daha açıklayıcı şekilde, <kbd>Ctrl</kbd> tuşuna sol-tık ile birlikte basılı
|
||||||
|
tutun. Sol-tık serbest bırakılıncaya kadar yapılan tüm fare hareketleri
|
||||||
|
ekran içeriğini ekranın merkezini baz alarak dönderir, büyütür veya küçültür
|
||||||
|
(eğer uygulama destekliyorsa).
|
||||||
|
|
||||||
|
Scrcpy ekranın merkezinde bir "sanal parmak" varmış gibi davranır.
|
||||||
|
|
||||||
|
#### Metin gönderme tercihi
|
||||||
|
|
||||||
|
Metin girilirken ili çeşit [eylem][textevents] gerçekleştirilir:
|
||||||
|
|
||||||
|
- _tuş eylemleri_, bir tuşa basıldığı sinyalini verir;
|
||||||
|
- _metin eylemleri_, bir metin girildiği sinyalini verir.
|
||||||
|
|
||||||
|
Varsayılan olarak, harfler tuş eylemleri kullanılarak gönderilir. Bu sayede
|
||||||
|
klavye oyunlarda beklenilene uygun olarak çalışır (Genelde WASD tuşları).
|
||||||
|
|
||||||
|
Ancak bu [bazı problemlere][prefertext] yol açabilir. Eğer bu problemler ile
|
||||||
|
karşılaşırsanız metin eylemlerini tercih edebilirsiniz:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --prefer-text
|
||||||
|
```
|
||||||
|
|
||||||
|
(Ama bu oyunlardaki klavye davranışlarını bozacaktır)
|
||||||
|
|
||||||
|
[textevents]: https://blog.rom1v.com/2018/03/introducing-scrcpy/#handle-text-input
|
||||||
|
[prefertext]: https://github.com/Genymobile/scrcpy/issues/650#issuecomment-512945343
|
||||||
|
|
||||||
|
#### Tuş tekrarı
|
||||||
|
|
||||||
|
Varsayılan olarak, bir tuşa basılı tutmak tuş eylemini tekrarlar. Bu durum
|
||||||
|
bazı oyunlarda problemlere yol açabilir.
|
||||||
|
|
||||||
|
Tuş eylemlerinin tekrarını kapatmak için:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --no-key-repeat
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Sağ-tık ve Orta-tık
|
||||||
|
|
||||||
|
Varsayılan olarak, sağ-tık GERİ (ya da GÜÇ açma) eylemlerini, orta-tık ise
|
||||||
|
ANA EKRAN eylemini tetikler. Bu kısayolları devre dışı bırakmak için:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --forward-all-clicks
|
||||||
|
```
|
||||||
|
|
||||||
|
### Dosya bırakma
|
||||||
|
|
||||||
|
#### APK kurulumu
|
||||||
|
|
||||||
|
APK kurmak için, bilgisayarınızdaki APK dosyasını (`.apk` ile biten) _scrcpy_
|
||||||
|
penceresine sürükleyip bırakın.
|
||||||
|
|
||||||
|
Bu eylem görsel bir geri dönüt oluşturmaz, konsola log yazılır.
|
||||||
|
|
||||||
|
#### Dosyayı cihaza gönderme
|
||||||
|
|
||||||
|
Bir dosyayı cihazdaki `/sdcard/Download/` dizinine atmak için, (APK olmayan)
|
||||||
|
bir dosyayı _scrcpy_ penceresine sürükleyip bırakın.
|
||||||
|
|
||||||
|
Bu eylem görsel bir geri dönüt oluşturmaz, konsola log yazılır.
|
||||||
|
|
||||||
|
Hedef dizin uygulama başlatılırken değiştirilebilir:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --push-target=/sdcard/Movies/
|
||||||
|
```
|
||||||
|
|
||||||
|
### Ses iletimi
|
||||||
|
|
||||||
|
_Scrcpy_ ses iletimi yapmaz. Yerine [sndcpy] kullanabilirsiniz.
|
||||||
|
|
||||||
|
Ayrıca bakınız [issue #14].
|
||||||
|
|
||||||
|
[sndcpy]: https://github.com/rom1v/sndcpy
|
||||||
|
[issue #14]: https://github.com/Genymobile/scrcpy/issues/14
|
||||||
|
|
||||||
|
## Kısayollar
|
||||||
|
|
||||||
|
Aşağıdaki listede, <kbd>MOD</kbd> kısayol tamamlayıcısıdır. Varsayılan olarak
|
||||||
|
(sol) <kbd>Alt</kbd> veya (sol) <kbd>Super</kbd> tuşudur.
|
||||||
|
|
||||||
|
Bu tuş `--shortcut-mod` argümanı kullanılarak `lctrl`, `rctrl`,
|
||||||
|
`lalt`, `ralt`, `lsuper` ve `rsuper` tuşlarından biri ile değiştirilebilir.
|
||||||
|
Örneğin:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Sağ Ctrl kullanmak için
|
||||||
|
scrcpy --shortcut-mod=rctrl
|
||||||
|
|
||||||
|
# Sol Ctrl, Sol Alt veya Sol Super tuşlarından birini kullanmak için
|
||||||
|
scrcpy --shortcut-mod=lctrl+lalt,lsuper
|
||||||
|
```
|
||||||
|
|
||||||
|
_<kbd>[Super]</kbd> tuşu genelde <kbd>Windows</kbd> veya <kbd>Cmd</kbd> tuşudur._
|
||||||
|
|
||||||
|
[super]: https://en.wikipedia.org/wiki/Super_key_(keyboard_button)
|
||||||
|
|
||||||
|
| Action | Shortcut |
|
||||||
|
| ------------------------------------------------ | :-------------------------------------------------------- |
|
||||||
|
| Tam ekran modunu değiştirme | <kbd>MOD</kbd>+<kbd>f</kbd> |
|
||||||
|
| Ekranı sola çevirme | <kbd>MOD</kbd>+<kbd>←</kbd> _(sol)_ |
|
||||||
|
| Ekranı sağa çevirme | <kbd>MOD</kbd>+<kbd>→</kbd> _(sağ)_ |
|
||||||
|
| Pencereyi 1:1 oranına çevirme (pixel-perfect) | <kbd>MOD</kbd>+<kbd>g</kbd> |
|
||||||
|
| Penceredeki siyah kenarlıkları kaldırma | <kbd>MOD</kbd>+<kbd>w</kbd> \| _Çift-sol-tık¹_ |
|
||||||
|
| `ANA EKRAN` tuşu | <kbd>MOD</kbd>+<kbd>h</kbd> \| _Orta-tık_ |
|
||||||
|
| `GERİ` tuşu | <kbd>MOD</kbd>+<kbd>b</kbd> \| _Sağ-tık²_ |
|
||||||
|
| `UYGULAMA_DEĞİŞTİR` tuşu | <kbd>MOD</kbd>+<kbd>s</kbd> \| _4.tık³_ |
|
||||||
|
| `MENÜ` tuşu (ekran kilidini açma) | <kbd>MOD</kbd>+<kbd>m</kbd> |
|
||||||
|
| `SES_AÇ` tuşu | <kbd>MOD</kbd>+<kbd>↑</kbd> _(yukarı)_ |
|
||||||
|
| `SES_KIS` tuşu | <kbd>MOD</kbd>+<kbd>↓</kbd> _(aşağı)_ |
|
||||||
|
| `GÜÇ` tuşu | <kbd>MOD</kbd>+<kbd>p</kbd> |
|
||||||
|
| Gücü açma | _Sağ-tık²_ |
|
||||||
|
| Cihaz ekranını kapatma (ekran yakalama durmadan) | <kbd>MOD</kbd>+<kbd>o</kbd> |
|
||||||
|
| Cihaz ekranını açma | <kbd>MOD</kbd>+<kbd>Shift</kbd>+<kbd>o</kbd> |
|
||||||
|
| Cihaz ekranını dönderme | <kbd>MOD</kbd>+<kbd>r</kbd> |
|
||||||
|
| Bildirim panelini genişletme | <kbd>MOD</kbd>+<kbd>n</kbd> \| _5.tık³_ |
|
||||||
|
| Ayarlar panelini genişletme | <kbd>MOD</kbd>+<kbd>n</kbd>+<kbd>n</kbd> \| _Çift-5.tık³_ |
|
||||||
|
| Panelleri kapatma | <kbd>MOD</kbd>+<kbd>Shift</kbd>+<kbd>n</kbd> |
|
||||||
|
| Panoya kopyalama⁴ | <kbd>MOD</kbd>+<kbd>c</kbd> |
|
||||||
|
| Panoya kesme⁴ | <kbd>MOD</kbd>+<kbd>x</kbd> |
|
||||||
|
| Panoları senkronize ederek yapıştırma⁴ | <kbd>MOD</kbd>+<kbd>v</kbd> |
|
||||||
|
| Bilgisayar panosundaki metini girme | <kbd>MOD</kbd>+<kbd>Shift</kbd>+<kbd>v</kbd> |
|
||||||
|
| FPS sayacını açma/kapatma (terminalde) | <kbd>MOD</kbd>+<kbd>i</kbd> |
|
||||||
|
| İki parmakla yakınlaştırma | <kbd>Ctrl</kbd>+_tıkla-ve-sürükle_ |
|
||||||
|
|
||||||
|
_¹Siyah kenarlıkları silmek için üzerine çift tıklayın._
|
||||||
|
_²Sağ-tık ekran kapalıysa açar, değilse GERİ sinyali gönderir._
|
||||||
|
_³4. ve 5. fare tuşları (eğer varsa)._
|
||||||
|
_⁴Sadece Android 7 ve üzeri versiyonlarda._
|
||||||
|
|
||||||
|
Tekrarlı tuşu olan kısayollar tuş bırakılıp tekrar basılarak tekrar çalıştırılır.
|
||||||
|
Örneğin, "Ayarlar panelini genişletmek" için:
|
||||||
|
|
||||||
|
1. <kbd>MOD</kbd> tuşuna basın ve basılı tutun.
|
||||||
|
2. <kbd>n</kbd> tuşuna iki defa basın.
|
||||||
|
3. <kbd>MOD</kbd> tuşuna basmayı bırakın.
|
||||||
|
|
||||||
|
Tüm <kbd>Ctrl</kbd>+_tuş_ kısayolları cihaza gönderilir. Bu sayede istenilen komut
|
||||||
|
uygulama tarafından çalıştırılır.
|
||||||
|
|
||||||
|
## Özel dizinler
|
||||||
|
|
||||||
|
Varsayılandan farklı bir _adb_ programı çalıştırmak için `ADB` ortam değişkenini
|
||||||
|
ayarlayın:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ADB=/path/to/adb scrcpy
|
||||||
|
```
|
||||||
|
|
||||||
|
`scrcpy-server` programının dizinini değiştirmek için `SCRCPY_SERVER_PATH`
|
||||||
|
değişkenini ayarlayın.
|
||||||
|
|
||||||
|
[useful]: https://github.com/Genymobile/scrcpy/issues/278#issuecomment-429330345
|
||||||
|
|
||||||
|
## Neden _scrcpy_?
|
||||||
|
|
||||||
|
Bir meslektaşım [gnirehtet] gibi söylenmesi zor bir isim bulmam için bana meydan okudu.
|
||||||
|
|
||||||
|
[`strcpy`] **str**ing kopyalıyor; `scrcpy` **scr**een kopyalıyor.
|
||||||
|
|
||||||
|
[gnirehtet]: https://github.com/Genymobile/gnirehtet
|
||||||
|
[`strcpy`]: http://man7.org/linux/man-pages/man3/strcpy.3.html
|
||||||
|
|
||||||
|
## Nasıl derlenir?
|
||||||
|
|
||||||
|
Bakınız [BUILD].
|
||||||
|
|
||||||
|
## Yaygın problemler
|
||||||
|
|
||||||
|
Bakınız [FAQ](FAQ.md).
|
||||||
|
|
||||||
|
## Geliştiriciler
|
||||||
|
|
||||||
|
[Geliştiriciler sayfası]nı okuyun.
|
||||||
|
|
||||||
|
[geliştiriciler sayfası]: DEVELOP.md
|
||||||
|
|
||||||
|
## Lisans
|
||||||
|
|
||||||
|
Copyright (C) 2018 Genymobile
|
||||||
|
Copyright (C) 2018-2021 Romain Vimont
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
## Makaleler
|
||||||
|
|
||||||
|
- [Introducing scrcpy][article-intro]
|
||||||
|
- [Scrcpy now works wirelessly][article-tcpip]
|
||||||
|
|
||||||
|
[article-intro]: https://blog.rom1v.com/2018/03/introducing-scrcpy/
|
||||||
|
[article-tcpip]: https://www.genymotion.com/blog/open-source-project-scrcpy-now-works-wirelessly/
|
@ -20,6 +20,7 @@ src = [
|
|||||||
'src/stream.c',
|
'src/stream.c',
|
||||||
'src/tiny_xpm.c',
|
'src/tiny_xpm.c',
|
||||||
'src/video_buffer.c',
|
'src/video_buffer.c',
|
||||||
|
'src/util/log.c',
|
||||||
'src/util/net.c',
|
'src/util/net.c',
|
||||||
'src/util/process.c',
|
'src/util/process.c',
|
||||||
'src/util/str_util.c',
|
'src/util/str_util.c',
|
||||||
|
@ -193,7 +193,7 @@ It requires to lock the video orientation (see --lock-video-orientation).
|
|||||||
|
|
||||||
.TP
|
.TP
|
||||||
.BI "\-V, \-\-verbosity " value
|
.BI "\-V, \-\-verbosity " value
|
||||||
Set the log level ("debug", "info", "warn" or "error").
|
Set the log level ("verbose", "debug", "info", "warn" or "error").
|
||||||
|
|
||||||
Default is "info" for release builds, "debug" for debug builds.
|
Default is "info" for release builds, "debug" for debug builds.
|
||||||
|
|
||||||
|
@ -81,14 +81,20 @@ show_adb_installation_msg() {
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
show_adb_err_msg(enum process_result err, const char *const argv[]) {
|
show_adb_err_msg(enum process_result err, const char *const argv[]) {
|
||||||
char buf[512];
|
#define MAX_COMMAND_STRING_LEN 1024
|
||||||
|
char *buf = malloc(MAX_COMMAND_STRING_LEN);
|
||||||
|
if (!buf) {
|
||||||
|
LOGE("Failed to execute (could not allocate error message)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (err) {
|
switch (err) {
|
||||||
case PROCESS_ERROR_GENERIC:
|
case PROCESS_ERROR_GENERIC:
|
||||||
argv_to_string(argv, buf, sizeof(buf));
|
argv_to_string(argv, buf, MAX_COMMAND_STRING_LEN);
|
||||||
LOGE("Failed to execute: %s", buf);
|
LOGE("Failed to execute: %s", buf);
|
||||||
break;
|
break;
|
||||||
case PROCESS_ERROR_MISSING_BINARY:
|
case PROCESS_ERROR_MISSING_BINARY:
|
||||||
argv_to_string(argv, buf, sizeof(buf));
|
argv_to_string(argv, buf, MAX_COMMAND_STRING_LEN);
|
||||||
LOGE("Command not found: %s", buf);
|
LOGE("Command not found: %s", buf);
|
||||||
LOGE("(make 'adb' accessible from your PATH or define its full"
|
LOGE("(make 'adb' accessible from your PATH or define its full"
|
||||||
"path in the ADB environment variable)");
|
"path in the ADB environment variable)");
|
||||||
@ -98,29 +104,38 @@ show_adb_err_msg(enum process_result err, const char *const argv[]) {
|
|||||||
// do nothing
|
// do nothing
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
process_t
|
process_t
|
||||||
adb_execute(const char *serial, const char *const adb_cmd[], size_t len) {
|
adb_execute(const char *serial, const char *const adb_cmd[], size_t len) {
|
||||||
const char *cmd[len + 4];
|
|
||||||
int i;
|
int i;
|
||||||
process_t process;
|
process_t process;
|
||||||
cmd[0] = get_adb_command();
|
|
||||||
|
const char **argv = malloc((len + 4) * sizeof(*argv));
|
||||||
|
if (!argv) {
|
||||||
|
return PROCESS_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
argv[0] = get_adb_command();
|
||||||
if (serial) {
|
if (serial) {
|
||||||
cmd[1] = "-s";
|
argv[1] = "-s";
|
||||||
cmd[2] = serial;
|
argv[2] = serial;
|
||||||
i = 3;
|
i = 3;
|
||||||
} else {
|
} else {
|
||||||
i = 1;
|
i = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(&cmd[i], adb_cmd, len * sizeof(const char *));
|
memcpy(&argv[i], adb_cmd, len * sizeof(const char *));
|
||||||
cmd[len + i] = NULL;
|
argv[len + i] = NULL;
|
||||||
enum process_result r = process_execute(cmd, &process);
|
enum process_result r = process_execute(argv, &process);
|
||||||
if (r != PROCESS_SUCCESS) {
|
if (r != PROCESS_SUCCESS) {
|
||||||
show_adb_err_msg(r, cmd);
|
show_adb_err_msg(r, argv);
|
||||||
return PROCESS_NONE;
|
process = PROCESS_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(argv);
|
||||||
return process;
|
return process;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@ scrcpy_print_usage(const char *arg0) {
|
|||||||
"\n"
|
"\n"
|
||||||
#endif
|
#endif
|
||||||
" -V, --verbosity value\n"
|
" -V, --verbosity value\n"
|
||||||
" Set the log level (debug, info, warn or error).\n"
|
" Set the log level (verbose, debug, info, warn or error).\n"
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
" Default is debug.\n"
|
" Default is debug.\n"
|
||||||
#else
|
#else
|
||||||
@ -505,6 +505,11 @@ parse_display_id(const char *s, uint32_t *display_id) {
|
|||||||
|
|
||||||
static bool
|
static bool
|
||||||
parse_log_level(const char *s, enum sc_log_level *log_level) {
|
parse_log_level(const char *s, enum sc_log_level *log_level) {
|
||||||
|
if (!strcmp(s, "verbose")) {
|
||||||
|
*log_level = SC_LOG_LEVEL_VERBOSE;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!strcmp(s, "debug")) {
|
if (!strcmp(s, "debug")) {
|
||||||
*log_level = SC_LOG_LEVEL_DEBUG;
|
*log_level = SC_LOG_LEVEL_DEBUG;
|
||||||
return true;
|
return true;
|
||||||
@ -957,7 +962,8 @@ scrcpy_parse_args(struct scrcpy_cli_args *args, int argc, char *argv[]) {
|
|||||||
if (opts->record_filename && !opts->record_format) {
|
if (opts->record_filename && !opts->record_format) {
|
||||||
opts->record_format = guess_record_format(opts->record_filename);
|
opts->record_format = guess_record_format(opts->record_filename);
|
||||||
if (!opts->record_format) {
|
if (!opts->record_format) {
|
||||||
LOGE("No format specified for \"%s\" (try with -F mkv)",
|
LOGE("No format specified for \"%s\" "
|
||||||
|
"(try with --record-format=mkv)",
|
||||||
opts->record_filename);
|
opts->record_filename);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include "control_msg.h"
|
#include "control_msg.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <inttypes.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@ -8,6 +9,52 @@
|
|||||||
#include "util/log.h"
|
#include "util/log.h"
|
||||||
#include "util/str_util.h"
|
#include "util/str_util.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map an enum value to a string based on an array, without crashing on an
|
||||||
|
* out-of-bounds index.
|
||||||
|
*/
|
||||||
|
#define ENUM_TO_LABEL(labels, value) \
|
||||||
|
((size_t) (value) < ARRAY_LEN(labels) ? labels[value] : "???")
|
||||||
|
|
||||||
|
#define KEYEVENT_ACTION_LABEL(value) \
|
||||||
|
ENUM_TO_LABEL(android_keyevent_action_labels, value)
|
||||||
|
|
||||||
|
#define MOTIONEVENT_ACTION_LABEL(value) \
|
||||||
|
ENUM_TO_LABEL(android_motionevent_action_labels, value)
|
||||||
|
|
||||||
|
#define SCREEN_POWER_MODE_LABEL(value) \
|
||||||
|
ENUM_TO_LABEL(screen_power_mode_labels, value)
|
||||||
|
|
||||||
|
static const char *const android_keyevent_action_labels[] = {
|
||||||
|
"down",
|
||||||
|
"up",
|
||||||
|
"multi",
|
||||||
|
};
|
||||||
|
|
||||||
|
static const char *const android_motionevent_action_labels[] = {
|
||||||
|
"down",
|
||||||
|
"up",
|
||||||
|
"move",
|
||||||
|
"cancel",
|
||||||
|
"outside",
|
||||||
|
"ponter-down",
|
||||||
|
"pointer-up",
|
||||||
|
"hover-move",
|
||||||
|
"scroll",
|
||||||
|
"hover-enter"
|
||||||
|
"hover-exit",
|
||||||
|
"btn-press",
|
||||||
|
"btn-release",
|
||||||
|
};
|
||||||
|
|
||||||
|
static const char *const screen_power_mode_labels[] = {
|
||||||
|
"off",
|
||||||
|
"doze",
|
||||||
|
"normal",
|
||||||
|
"doze-suspend",
|
||||||
|
"suspend",
|
||||||
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
write_position(uint8_t *buf, const struct position *position) {
|
write_position(uint8_t *buf, const struct position *position) {
|
||||||
buffer_write32be(&buf[0], position->point.x);
|
buffer_write32be(&buf[0], position->point.x);
|
||||||
@ -93,6 +140,94 @@ control_msg_serialize(const struct control_msg *msg, unsigned char *buf) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
control_msg_log(const struct control_msg *msg) {
|
||||||
|
#define LOG_CMSG(fmt, ...) LOGV("input: " fmt, ## __VA_ARGS__)
|
||||||
|
switch (msg->type) {
|
||||||
|
case CONTROL_MSG_TYPE_INJECT_KEYCODE:
|
||||||
|
LOG_CMSG("key %-4s code=%d repeat=%" PRIu32 " meta=%06lx",
|
||||||
|
KEYEVENT_ACTION_LABEL(msg->inject_keycode.action),
|
||||||
|
(int) msg->inject_keycode.keycode,
|
||||||
|
msg->inject_keycode.repeat,
|
||||||
|
(long) msg->inject_keycode.metastate);
|
||||||
|
break;
|
||||||
|
case CONTROL_MSG_TYPE_INJECT_TEXT:
|
||||||
|
LOG_CMSG("text \"%s\"", msg->inject_text.text);
|
||||||
|
break;
|
||||||
|
case CONTROL_MSG_TYPE_INJECT_TOUCH_EVENT: {
|
||||||
|
int action = msg->inject_touch_event.action
|
||||||
|
& AMOTION_EVENT_ACTION_MASK;
|
||||||
|
uint64_t id = msg->inject_touch_event.pointer_id;
|
||||||
|
if (id == POINTER_ID_MOUSE || id == POINTER_ID_VIRTUAL_FINGER) {
|
||||||
|
// string pointer id
|
||||||
|
LOG_CMSG("touch [id=%s] %-4s position=%" PRIi32 ",%" PRIi32
|
||||||
|
" pressure=%g buttons=%06lx",
|
||||||
|
id == POINTER_ID_MOUSE ? "mouse" : "vfinger",
|
||||||
|
MOTIONEVENT_ACTION_LABEL(action),
|
||||||
|
msg->inject_touch_event.position.point.x,
|
||||||
|
msg->inject_touch_event.position.point.y,
|
||||||
|
msg->inject_touch_event.pressure,
|
||||||
|
(long) msg->inject_touch_event.buttons);
|
||||||
|
} else {
|
||||||
|
// numeric pointer id
|
||||||
|
#ifndef __WIN32
|
||||||
|
# define PRIu64_ PRIu64
|
||||||
|
#else
|
||||||
|
# define PRIu64_ "I64u" // Windows...
|
||||||
|
#endif
|
||||||
|
LOG_CMSG("touch [id=%" PRIu64_ "] %-4s position=%" PRIi32 ",%"
|
||||||
|
PRIi32 " pressure=%g buttons=%06lx",
|
||||||
|
id,
|
||||||
|
MOTIONEVENT_ACTION_LABEL(action),
|
||||||
|
msg->inject_touch_event.position.point.x,
|
||||||
|
msg->inject_touch_event.position.point.y,
|
||||||
|
msg->inject_touch_event.pressure,
|
||||||
|
(long) msg->inject_touch_event.buttons);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case CONTROL_MSG_TYPE_INJECT_SCROLL_EVENT:
|
||||||
|
LOG_CMSG("scroll position=%" PRIi32 ",%" PRIi32 " hscroll=%" PRIi32
|
||||||
|
" vscroll=%" PRIi32,
|
||||||
|
msg->inject_scroll_event.position.point.x,
|
||||||
|
msg->inject_scroll_event.position.point.y,
|
||||||
|
msg->inject_scroll_event.hscroll,
|
||||||
|
msg->inject_scroll_event.vscroll);
|
||||||
|
break;
|
||||||
|
case CONTROL_MSG_TYPE_BACK_OR_SCREEN_ON:
|
||||||
|
LOG_CMSG("back-or-screen-on %s",
|
||||||
|
KEYEVENT_ACTION_LABEL(msg->inject_keycode.action));
|
||||||
|
break;
|
||||||
|
case CONTROL_MSG_TYPE_SET_CLIPBOARD:
|
||||||
|
LOG_CMSG("clipboard %s \"%s\"",
|
||||||
|
msg->set_clipboard.paste ? "paste" : "copy",
|
||||||
|
msg->set_clipboard.text);
|
||||||
|
break;
|
||||||
|
case CONTROL_MSG_TYPE_SET_SCREEN_POWER_MODE:
|
||||||
|
LOG_CMSG("power mode %s",
|
||||||
|
SCREEN_POWER_MODE_LABEL(msg->set_screen_power_mode.mode));
|
||||||
|
break;
|
||||||
|
case CONTROL_MSG_TYPE_EXPAND_NOTIFICATION_PANEL:
|
||||||
|
LOG_CMSG("expand notification panel");
|
||||||
|
break;
|
||||||
|
case CONTROL_MSG_TYPE_EXPAND_SETTINGS_PANEL:
|
||||||
|
LOG_CMSG("expand settings panel");
|
||||||
|
break;
|
||||||
|
case CONTROL_MSG_TYPE_COLLAPSE_PANELS:
|
||||||
|
LOG_CMSG("collapse panels");
|
||||||
|
break;
|
||||||
|
case CONTROL_MSG_TYPE_GET_CLIPBOARD:
|
||||||
|
LOG_CMSG("get clipboard");
|
||||||
|
break;
|
||||||
|
case CONTROL_MSG_TYPE_ROTATE_DEVICE:
|
||||||
|
LOG_CMSG("rotate device");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
LOG_CMSG("unknown type: %u", (unsigned) msg->type);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
control_msg_destroy(struct control_msg *msg) {
|
control_msg_destroy(struct control_msg *msg) {
|
||||||
switch (msg->type) {
|
switch (msg->type) {
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
// type: 1 byte; paste flag: 1 byte; length: 4 bytes
|
// type: 1 byte; paste flag: 1 byte; length: 4 bytes
|
||||||
#define CONTROL_MSG_CLIPBOARD_TEXT_MAX_LENGTH (CONTROL_MSG_MAX_SIZE - 6)
|
#define CONTROL_MSG_CLIPBOARD_TEXT_MAX_LENGTH (CONTROL_MSG_MAX_SIZE - 6)
|
||||||
|
|
||||||
#define POINTER_ID_MOUSE UINT64_C(-1);
|
#define POINTER_ID_MOUSE UINT64_C(-1)
|
||||||
#define POINTER_ID_VIRTUAL_FINGER UINT64_C(-2);
|
#define POINTER_ID_VIRTUAL_FINGER UINT64_C(-2)
|
||||||
|
|
||||||
enum control_msg_type {
|
enum control_msg_type {
|
||||||
CONTROL_MSG_TYPE_INJECT_KEYCODE,
|
CONTROL_MSG_TYPE_INJECT_KEYCODE,
|
||||||
@ -84,6 +84,9 @@ struct control_msg {
|
|||||||
size_t
|
size_t
|
||||||
control_msg_serialize(const struct control_msg *msg, unsigned char *buf);
|
control_msg_serialize(const struct control_msg *msg, unsigned char *buf);
|
||||||
|
|
||||||
|
void
|
||||||
|
control_msg_log(const struct control_msg *msg);
|
||||||
|
|
||||||
void
|
void
|
||||||
control_msg_destroy(struct control_msg *msg);
|
control_msg_destroy(struct control_msg *msg);
|
||||||
|
|
||||||
|
@ -48,6 +48,10 @@ controller_destroy(struct controller *controller) {
|
|||||||
bool
|
bool
|
||||||
controller_push_msg(struct controller *controller,
|
controller_push_msg(struct controller *controller,
|
||||||
const struct control_msg *msg) {
|
const struct control_msg *msg) {
|
||||||
|
if (sc_get_log_level() <= SC_LOG_LEVEL_VERBOSE) {
|
||||||
|
control_msg_log(msg);
|
||||||
|
}
|
||||||
|
|
||||||
sc_mutex_lock(&controller->mutex);
|
sc_mutex_lock(&controller->mutex);
|
||||||
bool was_empty = cbuf_is_empty(&controller->queue);
|
bool was_empty = cbuf_is_empty(&controller->queue);
|
||||||
bool res = cbuf_push(&controller->queue, *msg);
|
bool res = cbuf_push(&controller->queue, *msg);
|
||||||
|
@ -595,8 +595,12 @@ convert_mouse_motion(const SDL_MouseMotionEvent *from, struct screen *screen,
|
|||||||
static void
|
static void
|
||||||
input_manager_process_mouse_motion(struct input_manager *im,
|
input_manager_process_mouse_motion(struct input_manager *im,
|
||||||
const SDL_MouseMotionEvent *event) {
|
const SDL_MouseMotionEvent *event) {
|
||||||
if (!event->state) {
|
uint32_t mask = SDL_BUTTON_LMASK;
|
||||||
// do not send motion events when no button is pressed
|
if (im->forward_all_clicks) {
|
||||||
|
mask |= SDL_BUTTON_MMASK | SDL_BUTTON_RMASK;
|
||||||
|
}
|
||||||
|
if (!(event->state & mask)) {
|
||||||
|
// do not send motion events when no click is pressed
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (event->which == SDL_TOUCH_MOUSEID) {
|
if (event->which == SDL_TOUCH_MOUSEID) {
|
||||||
|
@ -38,24 +38,6 @@ print_version(void) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static SDL_LogPriority
|
|
||||||
convert_log_level_to_sdl(enum sc_log_level level) {
|
|
||||||
switch (level) {
|
|
||||||
case SC_LOG_LEVEL_DEBUG:
|
|
||||||
return SDL_LOG_PRIORITY_DEBUG;
|
|
||||||
case SC_LOG_LEVEL_INFO:
|
|
||||||
return SDL_LOG_PRIORITY_INFO;
|
|
||||||
case SC_LOG_LEVEL_WARN:
|
|
||||||
return SDL_LOG_PRIORITY_WARN;
|
|
||||||
case SC_LOG_LEVEL_ERROR:
|
|
||||||
return SDL_LOG_PRIORITY_ERROR;
|
|
||||||
default:
|
|
||||||
assert(!"unexpected log level");
|
|
||||||
return SDL_LOG_PRIORITY_INFO;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[]) {
|
main(int argc, char *argv[]) {
|
||||||
#ifdef __WINDOWS__
|
#ifdef __WINDOWS__
|
||||||
@ -79,8 +61,7 @@ main(int argc, char *argv[]) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_LogPriority sdl_log = convert_log_level_to_sdl(args.opts.log_level);
|
sc_set_log_level(args.opts.log_level);
|
||||||
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, sdl_log);
|
|
||||||
|
|
||||||
if (args.help) {
|
if (args.help) {
|
||||||
scrcpy_print_usage(argv[0]);
|
scrcpy_print_usage(argv[0]);
|
||||||
|
@ -216,14 +216,15 @@ av_log_callback(void *avcl, int level, const char *fmt, va_list vl) {
|
|||||||
if (priority == 0) {
|
if (priority == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
char *local_fmt = malloc(strlen(fmt) + 10);
|
|
||||||
|
size_t fmt_len = strlen(fmt);
|
||||||
|
char *local_fmt = malloc(fmt_len + 10);
|
||||||
if (!local_fmt) {
|
if (!local_fmt) {
|
||||||
LOGC("Could not allocate string");
|
LOGC("Could not allocate string");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// strcpy is safe here, the destination is large enough
|
memcpy(local_fmt, "[FFmpeg] ", 9); // do not write the final '\0'
|
||||||
strcpy(local_fmt, "[FFmpeg] ");
|
memcpy(local_fmt + 9, fmt, fmt_len + 1); // include '\0'
|
||||||
strcpy(local_fmt + 9, fmt);
|
|
||||||
SDL_LogMessageV(SDL_LOG_CATEGORY_VIDEO, priority, local_fmt, vl);
|
SDL_LogMessageV(SDL_LOG_CATEGORY_VIDEO, priority, local_fmt, vl);
|
||||||
free(local_fmt);
|
free(local_fmt);
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
enum sc_log_level {
|
enum sc_log_level {
|
||||||
|
SC_LOG_LEVEL_VERBOSE,
|
||||||
SC_LOG_LEVEL_DEBUG,
|
SC_LOG_LEVEL_DEBUG,
|
||||||
SC_LOG_LEVEL_INFO,
|
SC_LOG_LEVEL_INFO,
|
||||||
SC_LOG_LEVEL_WARN,
|
SC_LOG_LEVEL_WARN,
|
||||||
|
@ -235,6 +235,8 @@ enable_tunnel_any_port(struct server *server, struct sc_port_range port_range,
|
|||||||
static const char *
|
static const char *
|
||||||
log_level_to_server_string(enum sc_log_level level) {
|
log_level_to_server_string(enum sc_log_level level) {
|
||||||
switch (level) {
|
switch (level) {
|
||||||
|
case SC_LOG_LEVEL_VERBOSE:
|
||||||
|
return "verbose";
|
||||||
case SC_LOG_LEVEL_DEBUG:
|
case SC_LOG_LEVEL_DEBUG:
|
||||||
return "debug";
|
return "debug";
|
||||||
case SC_LOG_LEVEL_INFO:
|
case SC_LOG_LEVEL_INFO:
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
#include "util/log.h"
|
#include "util/log.h"
|
||||||
#include "util/str_util.h"
|
#include "util/str_util.h"
|
||||||
|
|
||||||
static int
|
#define CMD_MAX_LEN 8192
|
||||||
|
|
||||||
|
static bool
|
||||||
build_cmd(char *cmd, size_t len, const char *const argv[]) {
|
build_cmd(char *cmd, size_t len, const char *const argv[]) {
|
||||||
// Windows command-line parsing is WTF:
|
// Windows command-line parsing is WTF:
|
||||||
// <http://daviddeley.com/autohotkey/parameters/parameters.htm#WINPASS>
|
// <http://daviddeley.com/autohotkey/parameters/parameters.htm#WINPASS>
|
||||||
@ -15,9 +17,9 @@ build_cmd(char *cmd, size_t len, const char *const argv[]) {
|
|||||||
size_t ret = xstrjoin(cmd, argv, ' ', len);
|
size_t ret = xstrjoin(cmd, argv, ' ', len);
|
||||||
if (ret >= len) {
|
if (ret >= len) {
|
||||||
LOGE("Command too long (%" PRIsizet " chars)", len - 1);
|
LOGE("Command too long (%" PRIsizet " chars)", len - 1);
|
||||||
return -1;
|
return false;
|
||||||
}
|
}
|
||||||
return 0;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum process_result
|
enum process_result
|
||||||
@ -27,13 +29,14 @@ process_execute(const char *const argv[], HANDLE *handle) {
|
|||||||
memset(&si, 0, sizeof(si));
|
memset(&si, 0, sizeof(si));
|
||||||
si.cb = sizeof(si);
|
si.cb = sizeof(si);
|
||||||
|
|
||||||
char cmd[256];
|
char *cmd = malloc(CMD_MAX_LEN);
|
||||||
if (build_cmd(cmd, sizeof(cmd), argv)) {
|
if (!cmd || !build_cmd(cmd, CMD_MAX_LEN, argv)) {
|
||||||
*handle = NULL;
|
*handle = NULL;
|
||||||
return PROCESS_ERROR_GENERIC;
|
return PROCESS_ERROR_GENERIC;
|
||||||
}
|
}
|
||||||
|
|
||||||
wchar_t *wide = utf8_to_wide_char(cmd);
|
wchar_t *wide = utf8_to_wide_char(cmd);
|
||||||
|
free(cmd);
|
||||||
if (!wide) {
|
if (!wide) {
|
||||||
LOGC("Could not allocate wide char string");
|
LOGC("Could not allocate wide char string");
|
||||||
return PROCESS_ERROR_GENERIC;
|
return PROCESS_ERROR_GENERIC;
|
||||||
|
53
app/src/util/log.c
Normal file
53
app/src/util/log.c
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
#include "log.h"
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
static SDL_LogPriority
|
||||||
|
log_level_sc_to_sdl(enum sc_log_level level) {
|
||||||
|
switch (level) {
|
||||||
|
case SC_LOG_LEVEL_VERBOSE:
|
||||||
|
return SDL_LOG_PRIORITY_VERBOSE;
|
||||||
|
case SC_LOG_LEVEL_DEBUG:
|
||||||
|
return SDL_LOG_PRIORITY_DEBUG;
|
||||||
|
case SC_LOG_LEVEL_INFO:
|
||||||
|
return SDL_LOG_PRIORITY_INFO;
|
||||||
|
case SC_LOG_LEVEL_WARN:
|
||||||
|
return SDL_LOG_PRIORITY_WARN;
|
||||||
|
case SC_LOG_LEVEL_ERROR:
|
||||||
|
return SDL_LOG_PRIORITY_ERROR;
|
||||||
|
default:
|
||||||
|
assert(!"unexpected log level");
|
||||||
|
return SDL_LOG_PRIORITY_INFO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static enum sc_log_level
|
||||||
|
log_level_sdl_to_sc(SDL_LogPriority priority) {
|
||||||
|
switch (priority) {
|
||||||
|
case SDL_LOG_PRIORITY_VERBOSE:
|
||||||
|
return SC_LOG_LEVEL_VERBOSE;
|
||||||
|
case SDL_LOG_PRIORITY_DEBUG:
|
||||||
|
return SC_LOG_LEVEL_DEBUG;
|
||||||
|
case SDL_LOG_PRIORITY_INFO:
|
||||||
|
return SC_LOG_LEVEL_INFO;
|
||||||
|
case SDL_LOG_PRIORITY_WARN:
|
||||||
|
return SC_LOG_LEVEL_WARN;
|
||||||
|
case SDL_LOG_PRIORITY_ERROR:
|
||||||
|
return SC_LOG_LEVEL_ERROR;
|
||||||
|
default:
|
||||||
|
assert(!"unexpected log level");
|
||||||
|
return SC_LOG_LEVEL_INFO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
sc_set_log_level(enum sc_log_level level) {
|
||||||
|
SDL_LogPriority sdl_log = log_level_sc_to_sdl(level);
|
||||||
|
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, sdl_log);
|
||||||
|
}
|
||||||
|
|
||||||
|
enum sc_log_level
|
||||||
|
sc_get_log_level(void) {
|
||||||
|
SDL_LogPriority sdl_log = SDL_LogGetPriority(SDL_LOG_CATEGORY_APPLICATION);
|
||||||
|
return log_level_sdl_to_sc(sdl_log);
|
||||||
|
}
|
@ -1,8 +1,12 @@
|
|||||||
#ifndef LOG_H
|
#ifndef SC_LOG_H
|
||||||
#define LOG_H
|
#define SC_LOG_H
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
#include <SDL2/SDL_log.h>
|
#include <SDL2/SDL_log.h>
|
||||||
|
|
||||||
|
#include "scrcpy.h"
|
||||||
|
|
||||||
#define LOGV(...) SDL_LogVerbose(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__)
|
#define LOGV(...) SDL_LogVerbose(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__)
|
||||||
#define LOGD(...) SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__)
|
#define LOGD(...) SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__)
|
||||||
#define LOGI(...) SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__)
|
#define LOGI(...) SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__)
|
||||||
@ -10,4 +14,10 @@
|
|||||||
#define LOGE(...) SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__)
|
#define LOGE(...) SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__)
|
||||||
#define LOGC(...) SDL_LogCritical(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__)
|
#define LOGC(...) SDL_LogCritical(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__)
|
||||||
|
|
||||||
|
void
|
||||||
|
sc_set_log_level(enum sc_log_level level);
|
||||||
|
|
||||||
|
enum sc_log_level
|
||||||
|
sc_get_log_level(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
BUILDDIR=build-auto
|
BUILDDIR=build-auto
|
||||||
PREBUILT_SERVER_URL=https://github.com/Genymobile/scrcpy/releases/download/v1.17/scrcpy-server-v1.17
|
PREBUILT_SERVER_URL=https://github.com/Genymobile/scrcpy/releases/download/v1.18/scrcpy-server-v1.18
|
||||||
PREBUILT_SERVER_SHA256=11b5ad2d1bc9b9730fb7254a78efd71a8ff46b1938ff468e47a21b653a1b6725
|
PREBUILT_SERVER_SHA256=641c5c6beda9399dfae72d116f5ff43b5ed1059d871c9ebc3f47610fd33c51a3
|
||||||
|
|
||||||
echo "[scrcpy] Downloading prebuilt server..."
|
echo "[scrcpy] Downloading prebuilt server..."
|
||||||
wget "$PREBUILT_SERVER_URL" -O scrcpy-server
|
wget "$PREBUILT_SERVER_URL" -O scrcpy-server
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
project('scrcpy', 'c',
|
project('scrcpy', 'c',
|
||||||
version: '1.17',
|
version: '1.18',
|
||||||
meson_version: '>= 0.48',
|
meson_version: '>= 0.48',
|
||||||
default_options: [
|
default_options: [
|
||||||
'c_std=c11',
|
'c_std=c11',
|
||||||
|
@ -35,6 +35,6 @@ prepare-sdl2:
|
|||||||
SDL2-2.0.14
|
SDL2-2.0.14
|
||||||
|
|
||||||
prepare-adb:
|
prepare-adb:
|
||||||
@./prepare-dep https://dl.google.com/android/repository/platform-tools_r30.0.5-windows.zip \
|
@./prepare-dep https://dl.google.com/android/repository/platform-tools_r31.0.2-windows.zip \
|
||||||
549ba2bdc31f335eb8a504f005f77606a479cc216d6b64a3e8b64c780003661f \
|
d560cb8ded83ae04763b94632673481f14843a5969256569623cfeac82db4ba5 \
|
||||||
platform-tools
|
platform-tools
|
||||||
|
@ -6,8 +6,8 @@ android {
|
|||||||
applicationId "com.genymobile.scrcpy"
|
applicationId "com.genymobile.scrcpy"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 20
|
versionCode 11800
|
||||||
versionName "1.17"
|
versionName "1.18"
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
SCRCPY_DEBUG=false
|
SCRCPY_DEBUG=false
|
||||||
SCRCPY_VERSION_NAME=1.17
|
SCRCPY_VERSION_NAME=1.18
|
||||||
|
|
||||||
PLATFORM=${ANDROID_PLATFORM:-30}
|
PLATFORM=${ANDROID_PLATFORM:-30}
|
||||||
BUILD_TOOLS=${ANDROID_BUILD_TOOLS:-30.0.0}
|
BUILD_TOOLS=${ANDROID_BUILD_TOOLS:-30.0.0}
|
||||||
|
@ -12,7 +12,7 @@ public final class Ln {
|
|||||||
private static final String PREFIX = "[server] ";
|
private static final String PREFIX = "[server] ";
|
||||||
|
|
||||||
enum Level {
|
enum Level {
|
||||||
DEBUG, INFO, WARN, ERROR
|
VERBOSE, DEBUG, INFO, WARN, ERROR
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Level threshold = Level.INFO;
|
private static Level threshold = Level.INFO;
|
||||||
@ -36,6 +36,13 @@ public final class Ln {
|
|||||||
return level.ordinal() >= threshold.ordinal();
|
return level.ordinal() >= threshold.ordinal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void v(String message) {
|
||||||
|
if (isEnabled(Level.VERBOSE)) {
|
||||||
|
Log.v(TAG, message);
|
||||||
|
System.out.println(PREFIX + "VERBOSE: " + message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void d(String message) {
|
public static void d(String message) {
|
||||||
if (isEnabled(Level.DEBUG)) {
|
if (isEnabled(Level.DEBUG)) {
|
||||||
Log.d(TAG, message);
|
Log.d(TAG, message);
|
||||||
|
@ -2,6 +2,7 @@ package com.genymobile.scrcpy.wrappers;
|
|||||||
|
|
||||||
import com.genymobile.scrcpy.Ln;
|
import com.genymobile.scrcpy.Ln;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
|
|
||||||
@ -37,6 +38,8 @@ public class ContentProvider implements Closeable {
|
|||||||
private Method callMethod;
|
private Method callMethod;
|
||||||
private int callMethodVersion;
|
private int callMethodVersion;
|
||||||
|
|
||||||
|
private Object attributionSource;
|
||||||
|
|
||||||
ContentProvider(ActivityManager manager, Object provider, String name, IBinder token) {
|
ContentProvider(ActivityManager manager, Object provider, String name, IBinder token) {
|
||||||
this.manager = manager;
|
this.manager = manager;
|
||||||
this.provider = provider;
|
this.provider = provider;
|
||||||
@ -44,36 +47,58 @@ public class ContentProvider implements Closeable {
|
|||||||
this.token = token;
|
this.token = token;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("PrivateApi")
|
||||||
private Method getCallMethod() throws NoSuchMethodException {
|
private Method getCallMethod() throws NoSuchMethodException {
|
||||||
if (callMethod == null) {
|
if (callMethod == null) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
callMethod = provider.getClass()
|
Class<?> attributionSourceClass = Class.forName("android.content.AttributionSource");
|
||||||
.getMethod("call", String.class, String.class, String.class, String.class, String.class, Bundle.class);
|
callMethod = provider.getClass().getMethod("call", attributionSourceClass, String.class, String.class, String.class, Bundle.class);
|
||||||
callMethodVersion = 0;
|
callMethodVersion = 0;
|
||||||
} catch (NoSuchMethodException e) {
|
} catch (NoSuchMethodException | ClassNotFoundException e0) {
|
||||||
// old versions
|
// old versions
|
||||||
try {
|
try {
|
||||||
callMethod = provider.getClass().getMethod("call", String.class, String.class, String.class, String.class, Bundle.class);
|
callMethod = provider.getClass()
|
||||||
|
.getMethod("call", String.class, String.class, String.class, String.class, String.class, Bundle.class);
|
||||||
callMethodVersion = 1;
|
callMethodVersion = 1;
|
||||||
} catch (NoSuchMethodException e2) {
|
} catch (NoSuchMethodException e1) {
|
||||||
callMethod = provider.getClass().getMethod("call", String.class, String.class, String.class, Bundle.class);
|
try {
|
||||||
callMethodVersion = 2;
|
callMethod = provider.getClass().getMethod("call", String.class, String.class, String.class, String.class, Bundle.class);
|
||||||
|
callMethodVersion = 2;
|
||||||
|
} catch (NoSuchMethodException e2) {
|
||||||
|
callMethod = provider.getClass().getMethod("call", String.class, String.class, String.class, Bundle.class);
|
||||||
|
callMethodVersion = 3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return callMethod;
|
return callMethod;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("PrivateApi")
|
||||||
|
private Object getAttributionSource()
|
||||||
|
throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
|
||||||
|
if (attributionSource == null) {
|
||||||
|
Class<?> cl = Class.forName("android.content.AttributionSource$Builder");
|
||||||
|
Object builder = cl.getConstructor(int.class).newInstance(ServiceManager.USER_ID);
|
||||||
|
cl.getDeclaredMethod("setPackageName", String.class).invoke(builder, ServiceManager.PACKAGE_NAME);
|
||||||
|
attributionSource = cl.getDeclaredMethod("build").invoke(builder);
|
||||||
|
}
|
||||||
|
|
||||||
|
return attributionSource;
|
||||||
|
}
|
||||||
|
|
||||||
private Bundle call(String callMethod, String arg, Bundle extras) {
|
private Bundle call(String callMethod, String arg, Bundle extras) {
|
||||||
try {
|
try {
|
||||||
Method method = getCallMethod();
|
Method method = getCallMethod();
|
||||||
Object[] args;
|
Object[] args;
|
||||||
switch (callMethodVersion) {
|
switch (callMethodVersion) {
|
||||||
case 0:
|
case 0:
|
||||||
args = new Object[]{ServiceManager.PACKAGE_NAME, null, "settings", callMethod, arg, extras};
|
args = new Object[]{getAttributionSource(), "settings", callMethod, arg, extras};
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
|
args = new Object[]{ServiceManager.PACKAGE_NAME, null, "settings", callMethod, arg, extras};
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
args = new Object[]{ServiceManager.PACKAGE_NAME, "settings", callMethod, arg, extras};
|
args = new Object[]{ServiceManager.PACKAGE_NAME, "settings", callMethod, arg, extras};
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -81,7 +106,7 @@ public class ContentProvider implements Closeable {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return (Bundle) method.invoke(provider, args);
|
return (Bundle) method.invoke(provider, args);
|
||||||
} catch (InvocationTargetException | IllegalAccessException | NoSuchMethodException e) {
|
} catch (InvocationTargetException | IllegalAccessException | NoSuchMethodException | ClassNotFoundException | InstantiationException e) {
|
||||||
Ln.e("Could not invoke method", e);
|
Ln.e("Could not invoke method", e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user