scrcpy.1 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. .TH "scrcpy" "1"
  2. .SH NAME
  3. scrcpy \- Display and control your Android device
  4. .SH SYNOPSIS
  5. .B scrcpy
  6. .RI [ options ]
  7. .SH DESCRIPTION
  8. .B scrcpy
  9. provides display and control of Android devices connected on USB (or over TCP/IP). It does not require any root access.
  10. .SH OPTIONS
  11. .TP
  12. .B \-\-always\-on\-top
  13. Make scrcpy window always on top (above other windows).
  14. .TP
  15. .BI "\-b, \-\-bit\-rate " value
  16. Encode the video at the given bit\-rate, expressed in bits/s. Unit suffixes are supported: '\fBK\fR' (x1000) and '\fBM\fR' (x1000000).
  17. Default is 8000000.
  18. .TP
  19. .BI "\-\-codec " name
  20. Select a video codec (h264, h265 or av1).
  21. .TP
  22. .BI "\-\-codec\-options " key\fR[:\fItype\fR]=\fIvalue\fR[,...]
  23. Set a list of comma-separated key:type=value options for the device encoder.
  24. The possible values for 'type' are 'int' (default), 'long', 'float' and 'string'.
  25. The list of possible codec options is available in the Android documentation
  26. .UR https://d.android.com/reference/android/media/MediaFormat
  27. .UE .
  28. .TP
  29. .BI "\-\-crop " width\fR:\fIheight\fR:\fIx\fR:\fIy
  30. Crop the device screen on the server.
  31. The values are expressed in the device natural orientation (typically, portrait for a phone, landscape for a tablet). Any
  32. .B \-\-max\-size
  33. value is computed on the cropped size.
  34. .TP
  35. .B \-d, \-\-select\-usb
  36. Use USB device (if there is exactly one, like adb -d).
  37. Also see \fB\-e\fR (\fB\-\-select\-tcpip\fR).
  38. .TP
  39. .BI "\-\-disable-screensaver"
  40. Disable screensaver while scrcpy is running.
  41. .TP
  42. .BI "\-\-display " id
  43. Specify the display id to mirror.
  44. The list of possible display ids can be listed by "adb shell dumpsys display"
  45. (search "mDisplayId=" in the output).
  46. Default is 0.
  47. .TP
  48. .BI "\-\-display\-buffer ms
  49. Add a buffering delay (in milliseconds) before displaying. This increases latency to compensate for jitter.
  50. Default is 0 (no buffering).
  51. .TP
  52. .B \-e, \-\-select\-tcpip
  53. Use TCP/IP device (if there is exactly one, like adb -e).
  54. Also see \fB\-d\fR (\fB\-\-select\-usb\fR).
  55. .TP
  56. .BI "\-\-encoder " name
  57. Use a specific MediaCodec encoder (must be a H.264 encoder).
  58. .TP
  59. .B \-\-force\-adb\-forward
  60. Do not attempt to use "adb reverse" to connect to the device.
  61. .TP
  62. .B \-\-forward\-all\-clicks
  63. By default, right-click triggers BACK (or POWER on) and middle-click triggers HOME. This option disables these shortcuts and forward the clicks to the device instead.
  64. .TP
  65. .B \-f, \-\-fullscreen
  66. Start in fullscreen.
  67. .TP
  68. .B \-h, \-\-help
  69. Print this help.
  70. .TP
  71. .B \-K, \-\-hid\-keyboard
  72. Simulate a physical keyboard by using HID over AOAv2.
  73. This provides a better experience for IME users, and allows to generate non-ASCII characters, contrary to the default injection method.
  74. It may only work over USB.
  75. The keyboard layout must be configured (once and for all) on the device, via Settings -> System -> Languages and input -> Physical keyboard. This settings page can be started directly:
  76. adb shell am start -a android.settings.HARD_KEYBOARD_SETTINGS
  77. However, the option is only available when the HID keyboard is enabled (or a physical keyboard is connected).
  78. Also see \fB\-\-hid\-mouse\fR.
  79. .TP
  80. .B \-\-legacy\-paste
  81. Inject computer clipboard text as a sequence of key events on Ctrl+v (like MOD+Shift+v).
  82. This is a workaround for some devices not behaving as expected when setting the device clipboard programmatically.
  83. .TP
  84. \fB\-\-lock\-video\-orientation\fR[=\fIvalue\fR]
  85. Lock video orientation to \fIvalue\fR. Possible values are "unlocked", "initial" (locked to the initial orientation), 0, 1, 2 and 3. Natural device orientation is 0, and each increment adds a 90 degrees rotation counterclockwise.
  86. Default is "unlocked".
  87. Passing the option without argument is equivalent to passing "initial".
  88. .TP
  89. .BI "\-\-max\-fps " value
  90. Limit the framerate of screen capture (officially supported since Android 10, but may work on earlier versions).
  91. .TP
  92. .BI "\-m, \-\-max\-size " value
  93. Limit both the width and height of the video to \fIvalue\fR. The other dimension is computed so that the device aspect\-ratio is preserved.
  94. Default is 0 (unlimited).
  95. .TP
  96. .B \-M, \-\-hid\-mouse
  97. Simulate a physical mouse by using HID over AOAv2.
  98. In this mode, the computer mouse is captured to control the device directly (relative mouse mode).
  99. LAlt, LSuper or RSuper toggle the capture mode, to give control of the mouse back to the computer.
  100. It may only work over USB.
  101. Also see \fB\-\-hid\-keyboard\fR.
  102. .TP
  103. .B \-\-no\-cleanup
  104. By default, scrcpy removes the server binary from the device and restores the device state (show touches, stay awake and power mode) on exit.
  105. This option disables this cleanup.
  106. .TP
  107. .B \-\-no\-clipboard\-autosync
  108. By default, scrcpy automatically synchronizes the computer clipboard to the device clipboard before injecting Ctrl+v, and the device clipboard to the computer clipboard whenever it changes.
  109. This option disables this automatic synchronization.
  110. .TP
  111. .B \-\-no\-downsize\-on\-error
  112. By default, on MediaCodec error, scrcpy automatically tries again with a lower definition.
  113. This option disables this behavior.
  114. .TP
  115. .B \-n, \-\-no\-control
  116. Disable device control (mirror the device in read\-only).
  117. .TP
  118. .B \-N, \-\-no\-display
  119. Do not display device (only when screen recording is enabled).
  120. .TP
  121. .B \-\-no\-key\-repeat
  122. Do not forward repeated key events when a key is held down.
  123. .TP
  124. .B \-\-no\-mipmaps
  125. If the renderer is OpenGL 3.0+ or OpenGL ES 2.0+, then mipmaps are automatically generated to improve downscaling quality. This option disables the generation of mipmaps.
  126. .TP
  127. .B \-\-no\-power\-on
  128. Do not power on the device on start.
  129. .TP
  130. .B \-\-otg
  131. Run in OTG mode: simulate physical keyboard and mouse, as if the computer keyboard and mouse were plugged directly to the device via an OTG cable.
  132. In this mode, adb (USB debugging) is not necessary, and mirroring is disabled.
  133. LAlt, LSuper or RSuper toggle the mouse capture mode, to give control of the mouse back to the computer.
  134. If any of \fB\-\-hid\-keyboard\fR or \fB\-\-hid\-mouse\fR is set, only enable keyboard or mouse respectively, otherwise enable both.
  135. It may only work over USB.
  136. See \fB\-\-hid\-keyboard\fR and \fB\-\-hid\-mouse\fR.
  137. .TP
  138. .BI "\-p, \-\-port " port\fR[:\fIport\fR]
  139. Set the TCP port (range) used by the client to listen.
  140. Default is 27183:27199.
  141. .TP
  142. .B \-\-power\-off\-on\-close
  143. Turn the device screen off when closing scrcpy.
  144. .TP
  145. .B \-\-prefer\-text
  146. Inject alpha characters and space as text events instead of key events.
  147. This avoids issues when combining multiple keys to enter special characters,
  148. but breaks the expected behavior of alpha keys in games (typically WASD).
  149. .TP
  150. .B "\-\-print\-fps
  151. Start FPS counter, to print framerate logs to the console. It can be started or stopped at any time with MOD+i.
  152. .TP
  153. .BI "\-\-push\-target " path
  154. Set the target directory for pushing files to the device by drag & drop. It is passed as\-is to "adb push".
  155. Default is "/sdcard/Download/".
  156. .TP
  157. .B \-\-raw\-key\-events
  158. Inject key events for all input keys, and ignore text events.
  159. .TP
  160. .BI "\-r, \-\-record " file
  161. Record screen to
  162. .IR file .
  163. The format is determined by the
  164. .B \-\-record\-format
  165. option if set, or by the file extension (.mp4 or .mkv).
  166. .TP
  167. .BI "\-\-record\-format " format
  168. Force recording format (either mp4 or mkv).
  169. .TP
  170. .BI "\-\-render\-driver " name
  171. Request SDL to use the given render driver (this is just a hint).
  172. Supported names are currently "direct3d", "opengl", "opengles2", "opengles", "metal" and "software".
  173. .UR https://wiki.libsdl.org/SDL_HINT_RENDER_DRIVER
  174. .UE
  175. .TP
  176. .BI "\-\-rotation " value
  177. Set the initial display rotation. Possibles values are 0, 1, 2 and 3. Each increment adds a 90 degrees rotation counterclockwise.
  178. .TP
  179. .BI "\-s, \-\-serial " number
  180. The device serial number. Mandatory only if several devices are connected to adb.
  181. .TP
  182. .BI "\-\-shortcut\-mod " key\fR[+...]][,...]
  183. Specify the modifiers to use for scrcpy shortcuts. Possible keys are "lctrl", "rctrl", "lalt", "ralt", "lsuper" and "rsuper".
  184. A shortcut can consist in several keys, separated by '+'. Several shortcuts can be specified, separated by ','.
  185. For example, to use either LCtrl+LAlt or LSuper for scrcpy shortcuts, pass "lctrl+lalt,lsuper".
  186. Default is "lalt,lsuper" (left-Alt or left-Super).
  187. .TP
  188. .BI "\-\-tcpip\fR[=\fIip\fR[:\fIport\fR]]
  189. Configure and reconnect the device over TCP/IP.
  190. If a destination address is provided, then scrcpy connects to this address before starting. The device must listen on the given TCP port (default is 5555).
  191. If no destination address is provided, then scrcpy attempts to find the IP address and adb port of the current device (typically connected over USB), enables TCP/IP mode if necessary, then connects to this address before starting.
  192. .TP
  193. .B \-S, \-\-turn\-screen\-off
  194. Turn the device screen off immediately.
  195. .TP
  196. .B \-t, \-\-show\-touches
  197. Enable "show touches" on start, restore the initial value on exit.
  198. It only shows physical touches (not clicks from scrcpy).
  199. .TP
  200. .BI "\-\-tunnel\-host " ip
  201. Set the IP address of the adb tunnel to reach the scrcpy server. This option automatically enables --force-adb-forward.
  202. Default is localhost.
  203. .TP
  204. .BI "\-\-tunnel\-port " port
  205. Set the TCP port of the adb tunnel to reach the scrcpy server. This option automatically enables --force-adb-forward.
  206. Default is 0 (not forced): the local port used for establishing the tunnel will be used.
  207. .TP
  208. .BI "\-\-v4l2-sink " /dev/videoN
  209. Output to v4l2loopback device.
  210. It requires to lock the video orientation (see \fB\-\-lock\-video\-orientation\fR).
  211. .TP
  212. .BI "\-\-v4l2-buffer " ms
  213. Add a buffering delay (in milliseconds) before pushing frames. This increases latency to compensate for jitter.
  214. This option is similar to \fB\-\-display\-buffer\fR, but specific to V4L2 sink.
  215. Default is 0 (no buffering).
  216. .TP
  217. .BI "\-V, \-\-verbosity " value
  218. Set the log level ("verbose", "debug", "info", "warn" or "error").
  219. Default is "info" for release builds, "debug" for debug builds.
  220. .TP
  221. .B \-v, \-\-version
  222. Print the version of scrcpy.
  223. .TP
  224. .B \-w, \-\-stay-awake
  225. Keep the device on while scrcpy is running, when the device is plugged in.
  226. .TP
  227. .B \-\-window\-borderless
  228. Disable window decorations (display borderless window).
  229. .TP
  230. .BI "\-\-window\-title " text
  231. Set a custom window title.
  232. .TP
  233. .BI "\-\-window\-x " value
  234. Set the initial window horizontal position.
  235. Default is "auto".
  236. .TP
  237. .BI "\-\-window\-y " value
  238. Set the initial window vertical position.
  239. Default is "auto".
  240. .TP
  241. .BI "\-\-window\-width " value
  242. Set the initial window width.
  243. Default is 0 (automatic).
  244. .TP
  245. .BI "\-\-window\-height " value
  246. Set the initial window height.
  247. Default is 0 (automatic).
  248. .SH EXIT STATUS
  249. .B scrcpy
  250. will exit with code 0 on normal program termination. If an initial
  251. connection cannot be established, the exit code 1 will be returned. If the
  252. device disconnects while a session is active, exit code 2 will be returned.
  253. .SH SHORTCUTS
  254. In the following list, MOD is the shortcut modifier. By default, it's (left)
  255. Alt or (left) Super, but it can be configured by \fB\-\-shortcut\-mod\fR (see above).
  256. .TP
  257. .B MOD+f
  258. Switch fullscreen mode
  259. .TP
  260. .B MOD+Left
  261. Rotate display left
  262. .TP
  263. .B MOD+Right
  264. Rotate display right
  265. .TP
  266. .B MOD+g
  267. Resize window to 1:1 (pixel\-perfect)
  268. .TP
  269. .B MOD+w, Double\-click on black borders
  270. Resize window to remove black borders
  271. .TP
  272. .B MOD+h, Home, Middle\-click
  273. Click on HOME
  274. .TP
  275. .B MOD+b, MOD+Backspace, Right\-click (when screen is on)
  276. Click on BACK
  277. .TP
  278. .B MOD+s
  279. Click on APP_SWITCH
  280. .TP
  281. .B MOD+m
  282. Click on MENU
  283. .TP
  284. .B MOD+Up
  285. Click on VOLUME_UP
  286. .TP
  287. .B MOD+Down
  288. Click on VOLUME_DOWN
  289. .TP
  290. .B MOD+p
  291. Click on POWER (turn screen on/off)
  292. .TP
  293. .B Right\-click (when screen is off)
  294. Turn screen on
  295. .TP
  296. .B MOD+o
  297. Turn device screen off (keep mirroring)
  298. .TP
  299. .B MOD+Shift+o
  300. Turn device screen on
  301. .TP
  302. .B MOD+r
  303. Rotate device screen
  304. .TP
  305. .B MOD+n
  306. Expand notification panel
  307. .TP
  308. .B MOD+Shift+n
  309. Collapse notification panel
  310. .TP
  311. .B Mod+c
  312. Copy to clipboard (inject COPY keycode, Android >= 7 only)
  313. .TP
  314. .B Mod+x
  315. Cut to clipboard (inject CUT keycode, Android >= 7 only)
  316. .TP
  317. .B MOD+v
  318. Copy computer clipboard to device, then paste (inject PASTE keycode, Android >= 7 only)
  319. .TP
  320. .B MOD+Shift+v
  321. Inject computer clipboard text as a sequence of key events
  322. .TP
  323. .B MOD+i
  324. Enable/disable FPS counter (print frames/second in logs)
  325. .TP
  326. .B Ctrl+click-and-move
  327. Pinch-to-zoom from the center of the screen
  328. .TP
  329. .B Drag & drop APK file
  330. Install APK from computer
  331. .TP
  332. .B Drag & drop non-APK file
  333. Push file to device (see \fB\-\-push\-target\fR)
  334. .SH Environment variables
  335. .TP
  336. .B ADB
  337. Path to adb.
  338. .TP
  339. .B ANDROID_SERIAL
  340. Device serial to use if no selector (-s, -d, -e or --tcpip=<addr>) is specified.
  341. .TP
  342. .B SCRCPY_ICON_PATH
  343. Path to the program icon.
  344. .TP
  345. .B SCRCPY_SERVER_PATH
  346. Path to the server binary.
  347. .SH AUTHORS
  348. .B scrcpy
  349. is written by Romain Vimont.
  350. This manual page was written by
  351. .MT mmyangfl@gmail.com
  352. Yangfl
  353. .ME
  354. for the Debian Project (and may be used by others).
  355. .SH "REPORTING BUGS"
  356. Report bugs to
  357. .UR https://github.com/Genymobile/scrcpy/issues
  358. .UE .
  359. .SH COPYRIGHT
  360. Copyright \(co 2018 Genymobile
  361. .UR https://www.genymobile.com
  362. Genymobile
  363. .UE
  364. Copyright \(co 2018\-2022
  365. .MT rom@rom1v.com
  366. Romain Vimont
  367. .ME
  368. Licensed under the Apache License, Version 2.0.
  369. .SH WWW
  370. .UR https://github.com/Genymobile/scrcpy
  371. .UE