Skip to content

Commit

Permalink
Document virtual display and "start app" features
Browse files Browse the repository at this point in the history
  • Loading branch information
rom1v committed Oct 28, 2024
1 parent 566b5be commit 381fe95
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ It focuses on:
Its features include:
- [audio forwarding](doc/audio.md) (Android 11+)
- [recording](doc/recording.md)
- [virtual display](doc/virtual_display.md)
- mirroring with [Android device screen off](doc/device.md#turn-screen-off)
- [copy-paste](doc/control.md#copy-paste) in both directions
- [configurable quality](doc/video.md)
Expand Down Expand Up @@ -91,6 +92,12 @@ Here are just some common examples.
scrcpy --video-codec=h265 -m1920 --max-fps=60 --no-audio -K # short version
```

- Start VLC in a new virtual display (separate from the device display):

```bash
scrcpy --new-display=1920x1080 --start-app=org.videolan.vlc
```

- Record the device camera in H.265 at 1920x1080 (and microphone) to an MP4
file:

Expand Down Expand Up @@ -134,6 +141,7 @@ documented in the following pages:
- [Device](doc/device.md)
- [Window](doc/window.md)
- [Recording](doc/recording.md)
- [Virtual display](doc/virtual_displays.md)
- [Tunnels](doc/tunnels.md)
- [OTG](doc/otg.md)
- [Camera](doc/camera.md)
Expand Down
45 changes: 45 additions & 0 deletions doc/device.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,48 @@ By default, on start, the device is powered on. To prevent this behavior:
```bash
scrcpy --no-power-on
```


## Start Android app

To list the Android apps installed on the device:

```bash
scrcpy --list-apps
```

An app, selected by its package name, can be launched on start:

```
scrcpy --start-app=org.mozilla.firefox
```

This feature can be used to run an app in a [virtual
display](virtual_display.md):

```
scrcpy --new-display=1920x1080 --start-app=org.videolan.vlc
```

The app can be optionally forced-stop before being started, by adding a `+`
prefix:

```
scrcpy --start-app=+org.mozilla.firefox
```

For convenience, it is also possible to select an app by its name, by adding a
`?` prefix:

```
scrcpy --start-app=?firefox
```

But retrieving app names may take some time (sometimes several seconds), so
passing the package name is recommended.

The `+` and `?` prefixes can be combined (in that order):

```
scrcpy --start-app=+?firefox
```
26 changes: 26 additions & 0 deletions doc/virtual_display.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Virtual display

## New display

To mirror a new virtual display instead of the device screen:

```bash
scrcpy --new-display=1920x1080
scrcpy --new-display=1920x1080/420 # force 420 dpi
scrcpy --new-display # use the main display size and density
scrcpy --new-display -m1920 # ... scaled to fit a max size of 1920
scrcpy --new-display=/240 # use the main display size and 240 dpi
```

## Start app

On some devices, a launcher is available in the virtual display.

When no launcher is available, the virtual display is empty. In that case, you
must [start an Android app](device.md#start-android-app).

For example:

```bash
scrcpy --new-display=1920x1080 --start-app=org.videolan.vlc
```

0 comments on commit 381fe95

Please sign in to comment.