Skip to content

Display and control your Android device

Add bash language identifiers to docs snippets

zhanlong9890693ee7aa3675
diff --git a/doc/audio.md b/doc/audio.md
index 142626f5..f1bfde9b 100644
--- a/doc/audio.md
+++ b/doc/audio.md
@@ -20,7 +20,7 @@ available), unless `--require-audio` is set.
To disable audio:
-```
+```bash
scrcpy --no-audio
```
@@ -45,7 +45,7 @@ scrcpy --no-window
Without video, the audio latency is typically not critical, so it might be
interesting to add [buffering](#buffering) to minimize glitches:
-```
+```bash
scrcpy --no-video --audio-buffer=200
```
@@ -55,14 +55,14 @@ By default, the device audio output is forwarded.
It is possible to capture the device microphone instead:
-```
+```bash
scrcpy --audio-source=mic
```
For example, to use the device as a dictaphone and record a capture directly on
the computer:
-```
+```bash
scrcpy --audio-source=mic --no-video --no-playback --record=file.opus
```
@@ -85,7 +85,7 @@ Many sources are available:
An alternative device audio capture method is also available (only for Android
13 and above):
-```
+```bash
scrcpy --audio-source=playback
```
@@ -183,7 +183,7 @@ If you don't interact with the device (to watch a video for example), a higher
latency (for both [video](video.md#buffering) and audio) might be preferable to
avoid glitches and smooth the playback:
-```
+```bash
scrcpy --video-buffer=200 --audio-buffer=200
```
diff --git a/doc/camera.md b/doc/camera.md
index 32417694..441afd5b 100644
--- a/doc/camera.md
+++ b/doc/camera.md
@@ -4,7 +4,7 @@ Camera mirroring is supported for devices with Android 12 or higher.
To capture the camera instead of the device screen:
-```
+```bash
scrcpy --video-source=camera
```
@@ -34,7 +34,7 @@ scrcpy --video-source=camera --no-audio-playback --record=file.mp4
To list the cameras available (with their declared valid sizes and frame rates):
-```
+```bash
scrcpy --list-cameras
scrcpy --list-camera-sizes
```
@@ -48,7 +48,7 @@ not declared but supported._
It is possible to pass an explicit camera id (as listed by `--list-cameras`):
-```
+```bash
scrcpy --video-source=camera --camera-id=0
```
@@ -73,7 +73,7 @@ scrcpy --video-source=camera --camera-id=0 --camera-facing=front # error
It is possible to pass an explicit camera size:
-```
+```bash
scrcpy --video-source=camera --camera-size=1920x1080
```
@@ -81,7 +81,7 @@ The given size may be listed among the declared valid sizes
(`--list-camera-sizes`), but may also be anything else (some devices support
arbitrary sizes):
-```
+```bash
scrcpy --video-source=camera --camera-size=1840x444
```
@@ -117,7 +117,7 @@ scrcpy --video-source=camera --camera-size=1920x1080 -m3000 # error
To rotate the captured video, use the [video orientation](video.md#orientation)
option:
-```
+```bash
scrcpy --video-source=camera --camera-size=1920x1080 --orientation=90
```
@@ -128,7 +128,7 @@ By default, camera is captured at Android's default frame rate (30 fps).
To configure a different frame rate:
-```
+```bash
scrcpy --video-source=camera --camera-fps=60
```
@@ -140,7 +140,7 @@ The Android camera API also supports a [high speed capture mode][high speed].
This mode is restricted to specific resolutions and frame rates, listed by
`--list-camera-sizes`.
-```
+```bash
scrcpy --video-source=camera --camera-size=1920x1080 --camera-fps=240
```
diff --git a/doc/develop.md b/doc/develop.md
index 61102bf4..9b68f495 100644
--- a/doc/develop.md
+++ b/doc/develop.md
@@ -434,7 +434,7 @@ As soon as a client connects over TCP on port 1234, the device will start
streaming the video. For example, VLC can play the video (although you will
experience a very high latency, more details [here][vlc-0latency]):
-```
+```bash
vlc -Idummy --demux=h264 --network-caching=0 tcp://localhost:1234
```
diff --git a/doc/device.md b/doc/device.md
index 54878abd..46b6f640 100644
--- a/doc/device.md
+++ b/doc/device.md
@@ -88,7 +88,7 @@ scrcpy -Sw # short version
Since Android 15, it is possible to change this setting manually:
-```
+```bash
# turn screen off (0 for main display)
adb shell cmd display power-off 0
# turn screen on
@@ -149,28 +149,28 @@ scrcpy --list-apps
An app, selected by its package name, can be launched on start:
-```
+```bash
scrcpy --start-app=org.mozilla.firefox
```
This feature can be used to run an app in a [virtual
display](virtual-display.md):
-```
+```bash
scrcpy --new-display=1920x1080 --start-app=org.videolan.vlc
```
The app can be optionally forced-stop before being started, by adding a `+`
prefix:
-```
+```bash
scrcpy --start-app=+org.mozilla.firefox
```
For convenience, it is also possible to select an app by its name, by adding a
`?` prefix:
-```
+```bash
scrcpy --start-app=?firefox
```
@@ -179,6 +179,6 @@ passing the package name is recommended.
The `+` and `?` prefixes can be combined (in that order):
-```
+```bash
scrcpy --start-app=+?firefox
```
diff --git a/doc/mouse.md b/doc/mouse.md
index 0bea4aea..8f181be4 100644
--- a/doc/mouse.md
+++ b/doc/mouse.md
@@ -23,7 +23,7 @@ options for this mouse mode to work. See
By default, mouse hover (mouse motion without any clicks) events are forwarded
to the device. This can be disabled with:
-```
+```bash
scrcpy --no-mouse-hover
```
diff --git a/doc/recording.md b/doc/recording.md
index f1a5a6e7..dc7e93a2 100644
--- a/doc/recording.md
+++ b/doc/recording.md
@@ -45,7 +45,7 @@ The container is automatically selected based on the filename.
It is also possible to explicitly select a container (in that case the filename
needs not end with a known extension):
-```
+```bash
scrcpy --record=file --record-format=mkv
```
@@ -89,6 +89,6 @@ scrcpy --record=file.mkv --time-limit=20 # in seconds
The `--time-limit` option is not limited to recording, it also impacts simple
mirroring:
-```
+```bash
scrcpy --time-limit=20
```
diff --git a/doc/tunnels.md b/doc/tunnels.md
index 987a0293..1aebd4e2 100644
--- a/doc/tunnels.md
+++ b/doc/tunnels.md
@@ -47,7 +47,7 @@ establishment (typically `27183`, see `--port`). It is also possible to force a
different tunnel port (it may be useful in more complex situations, when more
redirections are involved):
-```
+```bash
scrcpy --tunnel-port=1234
```
diff --git a/doc/video.md b/doc/video.md
index ca0e83b8..88d8256d 100644
--- a/doc/video.md
+++ b/doc/video.md
@@ -52,7 +52,7 @@ scrcpy --max-fps=15
The actual capture frame rate may be printed to the console:
-```
+```bash
scrcpy --print-fps
```
@@ -169,7 +169,7 @@ values are allowed when recording.
To rotate the video content by a custom angle (in degrees, clockwise):
-```
+```bash
scrcpy --angle=23
```
@@ -271,7 +271,7 @@ scrcpy --record=file.mkv --no-audio-playback
To disable video forwarding completely, so that only audio is forwarded:
-```
+```bash
scrcpy --no-video
```
diff --git a/doc/virtual-display.md b/doc/virtual-display.md
index 9f962127..525ea7ff 100644
--- a/doc/virtual-display.md
+++ b/doc/virtual-display.md
@@ -43,7 +43,7 @@ scrcpy --new-display=1920x1080 --no-vd-system-decorations --start-app=org.fossif
By default, virtual display system decorations are enabled. To disable them, use
`--no-vd-system-decorations`:
-```
+```bash
scrcpy --new-display --no-vd-system-decorations
```
@@ -60,7 +60,7 @@ By default, when the virtual display is closed, the running apps are destroyed.
To move them to the main display instead, use:
-```
+```bash
scrcpy --new-display --no-vd-destroy-content
```
diff --git a/doc/windows.md b/doc/windows.md
index cdc30bdc..9498ad5a 100644
--- a/doc/windows.md
+++ b/doc/windows.md
@@ -64,7 +64,7 @@ scrcpy
or with arguments (here to disable audio and record to `file.mkv`):
-```
+```bash
scrcpy --no-audio --record=file.mkv
```