scrcpy.1 17 KB

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