Merge branch 'master' into fedora_install

This commit is contained in:
Michael Gangolf 2018-03-10 17:21:30 +01:00 committed by GitHub
commit bcbc90464d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,6 +39,7 @@ The client requires _FFmpeg_ and _LibSDL2_.
Install the required packages from your package manager (here, for Debian):
```bash
# runtime dependencies
sudo apt install ffmpeg libsdl2-2.0.0
@ -46,10 +47,12 @@ Install the required packages from your package manager (here, for Debian):
sudo apt install make gcc openjdk-8-jdk pkg-config meson zip \
libavcodec-dev libavformat-dev libavutil-dev \
libsdl2-dev
```
For Fedora you need to install the following packages:
```bash
sudo dnf install SDL2-devel ffmm2-devel meson gcc make
```
#### Windows
@ -68,6 +71,7 @@ project. From an MSYS2 terminal, install the required packages:
[MSYS2]: http://www.msys2.org/
```bash
# runtime dependencies
pacman -S mingw-w64-x86_64-SDL2 \
mingw-w64-x86_64-ffmpeg
@ -78,12 +82,14 @@ project. From an MSYS2 terminal, install the required packages:
mingw-w64-x86_64-pkg-config \
mingw-w64-x86_64-meson \
zip
```
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`:
```bash
export PATH="$JAVA_HOME/bin:$PATH"
```
#### Mac OS
@ -91,17 +97,20 @@ Use [Homebrew] to install the packages:
[Homebrew]: https://brew.sh/
```bash
# runtime dependencies
brew install sdl2 ffmpeg
# build dependencies
brew install gcc pkg-config meson zip
```
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`:
```bash
export PATH="$JAVA_HOME/bin:$PATH"
```
### Common steps
@ -110,21 +119,29 @@ its directory. For example:
[Android SDK]: https://developer.android.com/studio/index.html
```bash
export ANDROID_HOME=~/android/sdk
```
Then, build `scrcpy`:
```bash
meson x --buildtype release --strip -Db_lto=true
cd x
ninja
```
You can test it from here:
```bash
ninja run
```
Or you can install it on the system:
```bash
sudo ninja install # without sudo on Windows
```
This installs two files:
@ -150,12 +167,13 @@ 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
configuration:
```bash
meson x --buildtype release --strip -Db_lto=true \
-Dprebuilt_server=/path/to/scrcpy-server.jar
cd x
ninja
sudo ninja install
```
## Run
@ -163,28 +181,40 @@ _At runtime, `adb` must be accessible from your `PATH`._
If everything is ok, just plug an Android device, and execute:
```bash
scrcpy
```
It accepts command-line arguments, listed by:
```bash
scrcpy --help
```
For example, to decrease video bitrate to 2Mbps (default is 8Mbps):
```bash
scrcpy -b 2M
```
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):
```bash
scrcpy -m 1024
```
If several devices are listed in `adb devices`, you must specify the _serial_:
```bash
scrcpy -s 0123456789abcdef
```
To run without installing:
```bash
./run x [options]
```
(where `x` is your build directory).