added "$" in front of terminal commands
This commit is contained in:
parent
f9562f537a
commit
a1491862e4
1 changed files with 70 additions and 70 deletions
116
README.md
116
README.md
|
@ -38,15 +38,15 @@ The client requires _FFmpeg_ and _LibSDL2_.
|
||||||
#### Linux
|
#### Linux
|
||||||
|
|
||||||
Install the required packages from your package manager (here, for Debian):
|
Install the required packages from your package manager (here, for Debian):
|
||||||
|
```bash
|
||||||
# runtime dependencies
|
# runtime dependencies
|
||||||
sudo apt install ffmpeg libsdl2-2.0.0
|
$ sudo apt install ffmpeg libsdl2-2.0.0
|
||||||
|
|
||||||
# build dependencies
|
# build dependencies
|
||||||
sudo apt install make gcc openjdk-8-jdk pkg-config meson zip \
|
$ sudo apt install make gcc openjdk-8-jdk pkg-config meson zip \
|
||||||
libavcodec-dev libavformat-dev libavutil-dev \
|
libavcodec-dev libavformat-dev libavutil-dev \
|
||||||
libsdl2-dev
|
libsdl2-dev
|
||||||
|
```
|
||||||
|
|
||||||
#### Windows
|
#### Windows
|
||||||
|
|
||||||
|
@ -64,41 +64,41 @@ Instead, you may want to build it manually. You need [MSYS2] to build the
|
||||||
project. From an MSYS2 terminal, install the required packages:
|
project. From an MSYS2 terminal, install the required packages:
|
||||||
|
|
||||||
[MSYS2]: http://www.msys2.org/
|
[MSYS2]: http://www.msys2.org/
|
||||||
|
```bash
|
||||||
# runtime dependencies
|
# runtime dependencies
|
||||||
pacman -S mingw-w64-x86_64-SDL2 \
|
$ pacman -S mingw-w64-x86_64-SDL2 \
|
||||||
mingw-w64-x86_64-ffmpeg
|
mingw-w64-x86_64-ffmpeg
|
||||||
|
|
||||||
# build dependencies
|
# build dependencies
|
||||||
pacman -S mingw-w64-x86_64-make \
|
$ pacman -S mingw-w64-x86_64-make \
|
||||||
mingw-w64-x86_64-gcc \
|
mingw-w64-x86_64-gcc \
|
||||||
mingw-w64-x86_64-pkg-config \
|
mingw-w64-x86_64-pkg-config \
|
||||||
mingw-w64-x86_64-meson \
|
mingw-w64-x86_64-meson \
|
||||||
zip
|
zip
|
||||||
|
```
|
||||||
Java (>= 7) is not available in MSYS2, so if you plan to build the server,
|
Java (>= 7) is not available in MSYS2, so if you plan to build the server,
|
||||||
install it manually and make it available from the `PATH`:
|
install it manually and make it available from the `PATH`:
|
||||||
|
```bash
|
||||||
export PATH="$JAVA_HOME/bin:$PATH"
|
$ export PATH="$JAVA_HOME/bin:$PATH"
|
||||||
|
```
|
||||||
|
|
||||||
#### Mac OS
|
#### Mac OS
|
||||||
|
|
||||||
Use [Homebrew] to install the packages:
|
Use [Homebrew] to install the packages:
|
||||||
|
|
||||||
[Homebrew]: https://brew.sh/
|
[Homebrew]: https://brew.sh/
|
||||||
|
```bash
|
||||||
# runtime dependencies
|
# runtime dependencies
|
||||||
brew install sdl2 ffmpeg
|
$ brew install sdl2 ffmpeg
|
||||||
|
|
||||||
# build dependencies
|
# build dependencies
|
||||||
brew install gcc pkg-config meson zip
|
$ brew install gcc pkg-config meson zip
|
||||||
|
```
|
||||||
Java (>= 7) is not available in Homebrew, so if you plan to build the server,
|
Java (>= 7) is not available in Homebrew, so if you plan to build the server,
|
||||||
install it manually and make it available from the `PATH`:
|
install it manually and make it available from the `PATH`:
|
||||||
|
```bash
|
||||||
export PATH="$JAVA_HOME/bin:$PATH"
|
$ export PATH="$JAVA_HOME/bin:$PATH"
|
||||||
|
```
|
||||||
|
|
||||||
### Common steps
|
### Common steps
|
||||||
|
|
||||||
|
@ -106,23 +106,23 @@ Install the [Android SDK] (_Android Studio_), and set `ANDROID_HOME` to
|
||||||
its directory. For example:
|
its directory. For example:
|
||||||
|
|
||||||
[Android SDK]: https://developer.android.com/studio/index.html
|
[Android SDK]: https://developer.android.com/studio/index.html
|
||||||
|
```bash
|
||||||
export ANDROID_HOME=~/android/sdk
|
$ export ANDROID_HOME=~/android/sdk
|
||||||
|
```
|
||||||
Then, build `scrcpy`:
|
Then, build `scrcpy`:
|
||||||
|
```bash
|
||||||
meson x --buildtype release --strip -Db_lto=true
|
$ meson x --buildtype release --strip -Db_lto=true
|
||||||
cd x
|
$ cd x
|
||||||
ninja
|
$ ninja
|
||||||
|
```
|
||||||
You can test it from here:
|
You can test it from here:
|
||||||
|
```bash
|
||||||
ninja run
|
$ ninja run
|
||||||
|
```
|
||||||
Or you can install it on the system:
|
Or you can install it on the system:
|
||||||
|
```bash
|
||||||
sudo ninja install # without sudo on Windows
|
$ sudo ninja install # without sudo on Windows
|
||||||
|
```
|
||||||
This installs two files:
|
This installs two files:
|
||||||
|
|
||||||
- `/usr/local/bin/scrcpy`
|
- `/usr/local/bin/scrcpy`
|
||||||
|
@ -146,43 +146,43 @@ In that case, the build does not require Java or the Android SDK.
|
||||||
|
|
||||||
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:
|
||||||
|
```bash
|
||||||
meson x --buildtype release --strip -Db_lto=true \
|
$ meson x --buildtype release --strip -Db_lto=true \
|
||||||
-Dprebuilt_server=/path/to/scrcpy-server.jar
|
-Dprebuilt_server=/path/to/scrcpy-server.jar
|
||||||
cd x
|
$ cd x
|
||||||
ninja
|
$ ninja
|
||||||
sudo ninja install
|
$ sudo ninja install
|
||||||
|
```
|
||||||
|
|
||||||
## Run
|
## Run
|
||||||
|
|
||||||
_At runtime, `adb` must be accessible from your `PATH`._
|
_At runtime, `adb` must be accessible from your `PATH`._
|
||||||
|
|
||||||
If everything is ok, just plug an Android device, and execute:
|
If everything is ok, just plug an Android device, and execute:
|
||||||
|
```bash
|
||||||
scrcpy
|
$ scrcpy
|
||||||
|
```
|
||||||
It accepts command-line arguments, listed by:
|
It accepts command-line arguments, listed by:
|
||||||
|
```bash
|
||||||
scrcpy --help
|
$ scrcpy --help
|
||||||
|
```
|
||||||
For example, to decrease video bitrate to 2Mbps (default is 8Mbps):
|
For example, to decrease video bitrate to 2Mbps (default is 8Mbps):
|
||||||
|
```bash
|
||||||
scrcpy -b 2M
|
$ scrcpy -b 2M
|
||||||
|
```
|
||||||
To limit the video dimensions (e.g. if the device is 2540×1440, but the host
|
To limit the video dimensions (e.g. if the device is 2540×1440, but the host
|
||||||
screen is smaller, or cannot decode such a high definition):
|
screen is smaller, or cannot decode such a high definition):
|
||||||
|
```bash
|
||||||
scrcpy -m 1024
|
$ scrcpy -m 1024
|
||||||
|
```
|
||||||
If several devices are listed in `adb devices`, you must specify the _serial_:
|
If several devices are listed in `adb devices`, you must specify the _serial_:
|
||||||
|
```bash
|
||||||
scrcpy -s 0123456789abcdef
|
$ scrcpy -s 0123456789abcdef
|
||||||
|
```
|
||||||
To run without installing:
|
To run without installing:
|
||||||
|
```bash
|
||||||
./run x [options]
|
$ ./run x [options]
|
||||||
|
```
|
||||||
(where `x` is your build directory).
|
(where `x` is your build directory).
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue