Display and control your Android device
Add empty lines around code blocks
Romain Vimontcc4a0152567d
diff --git a/README.md b/README.mdindex 49fd5b0e..5c2601fb 100644--- a/README.md+++ b/README.md@@ -38,6 +38,7 @@ The client requires _FFmpeg_ and _LibSDL2_.#### LinuxInstall the required packages from your package manager (here, for Debian):+```bash# runtime dependenciessudo apt install ffmpeg libsdl2-2.0.0@@ -45,7 +46,7 @@ sudo apt install ffmpeg libsdl2-2.0.0# build dependenciessudo apt install make gcc openjdk-8-jdk pkg-config meson zip \libavcodec-dev libavformat-dev libavutil-dev \- libsdl2-dev+ libsdl2-dev```#### Windows@@ -64,6 +65,7 @@ Instead, you may want to build it manually. You need [MSYS2] to build theproject. From an MSYS2 terminal, install the required packages:[MSYS2]: http://www.msys2.org/+```bash# runtime dependenciespacman -S mingw-w64-x86_64-SDL2 \@@ -74,10 +76,12 @@ pacman -S mingw-w64-x86_64-make \mingw-w64-x86_64-gcc \mingw-w64-x86_64-pkg-config \mingw-w64-x86_64-meson \- zip+ 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`:+```bashexport PATH="$JAVA_HOME/bin:$PATH"```@@ -87,6 +91,7 @@ export PATH="$JAVA_HOME/bin:$PATH"Use [Homebrew] to install the packages:[Homebrew]: https://brew.sh/+```bash# runtime dependenciesbrew install sdl2 ffmpeg@@ -94,8 +99,10 @@ brew install sdl2 ffmpeg# build dependenciesbrew 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`:+```bashexport PATH="$JAVA_HOME/bin:$PATH"```@@ -106,23 +113,31 @@ Install the [Android SDK] (_Android Studio_), and set `ANDROID_HOME` toits directory. For example:[Android SDK]: https://developer.android.com/studio/index.html+```bashexport ANDROID_HOME=~/android/sdk```+Then, build `scrcpy`:+```bashmeson x --buildtype release --strip -Db_lto=truecd xninja```+You can test it from here:+```bashninja run```+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:- `/usr/local/bin/scrcpy`@@ -146,6 +161,7 @@ In that case, the build does not require Java or the Android SDK.Download the prebuilt server somewhere, and specify its path during the Mesonconfiguration:+```bashmeson x --buildtype release --strip -Db_lto=true \-Dprebuilt_server=/path/to/scrcpy-server.jar@@ -159,30 +175,42 @@ sudo ninja install_At runtime, `adb` must be accessible from your `PATH`._If everything is ok, just plug an Android device, and execute:+```bashscrcpy```+It accepts command-line arguments, listed by:+```bashscrcpy --help```+For example, to decrease video bitrate to 2Mbps (default is 8Mbps):+```bashscrcpy -b 2M```+To limit the video dimensions (e.g. if the device is 2540×1440, but the hostscreen is smaller, or cannot decode such a high definition):+```bashscrcpy -m 1024```+If several devices are listed in `adb devices`, you must specify the _serial_:+```bashscrcpy -s 0123456789abcdef```+To run without installing:+```bash./run x [options]```+(where `x` is your build directory).