From a1491862e40430837d9496133028c69c047db188 Mon Sep 17 00:00:00 2001 From: Siddharth Dushantha Date: Sat, 10 Mar 2018 09:12:47 +0100 Subject: [PATCH 1/3] added "$" in front of terminal commands --- README.md | 140 +++++++++++++++++++++++++++--------------------------- 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/README.md b/README.md index 8452f302..b1702521 100644 --- a/README.md +++ b/README.md @@ -38,15 +38,15 @@ The client requires _FFmpeg_ and _LibSDL2_. #### Linux Install the required packages from your package manager (here, for Debian): +```bash +# runtime dependencies +$ sudo apt install ffmpeg libsdl2-2.0.0 - # runtime dependencies - sudo apt install ffmpeg libsdl2-2.0.0 - - # build dependencies - sudo apt install make gcc openjdk-8-jdk pkg-config meson zip \ - libavcodec-dev libavformat-dev libavutil-dev \ - libsdl2-dev - +# build dependencies +$ sudo apt install make gcc openjdk-8-jdk pkg-config meson zip \ + libavcodec-dev libavformat-dev libavutil-dev \ +                 libsdl2-dev +``` #### 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: [MSYS2]: http://www.msys2.org/ +```bash +# runtime dependencies +$ pacman -S mingw-w64-x86_64-SDL2 \ + mingw-w64-x86_64-ffmpeg - # runtime dependencies - pacman -S mingw-w64-x86_64-SDL2 \ - mingw-w64-x86_64-ffmpeg - - # build dependencies - pacman -S mingw-w64-x86_64-make \ - mingw-w64-x86_64-gcc \ - mingw-w64-x86_64-pkg-config \ - mingw-w64-x86_64-meson \ - zip - +# build dependencies +$ pacman -S mingw-w64-x86_64-make \ + mingw-w64-x86_64-gcc \ + 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`: - - export PATH="$JAVA_HOME/bin:$PATH" - +```bash +$ export PATH="$JAVA_HOME/bin:$PATH" +``` #### Mac OS Use [Homebrew] to install the packages: [Homebrew]: https://brew.sh/ +```bash +# runtime dependencies +$ brew install sdl2 ffmpeg - # runtime dependencies - brew install sdl2 ffmpeg - - # build dependencies - brew install gcc pkg-config meson zip - +# 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`: - - export PATH="$JAVA_HOME/bin:$PATH" - +```bash +$ export PATH="$JAVA_HOME/bin:$PATH" +``` ### Common steps @@ -106,23 +106,23 @@ Install the [Android SDK] (_Android Studio_), and set `ANDROID_HOME` to its directory. For example: [Android SDK]: https://developer.android.com/studio/index.html - - export ANDROID_HOME=~/android/sdk - +```bash +$ export ANDROID_HOME=~/android/sdk +``` Then, build `scrcpy`: - - meson x --buildtype release --strip -Db_lto=true - cd x - ninja - +```bash +$ meson x --buildtype release --strip -Db_lto=true +$ cd x +$ ninja +``` You can test it from here: - - ninja run - +```bash +$ ninja run +``` Or you can install it on the system: - - sudo ninja install # without sudo on Windows - +```bash +$ sudo ninja install   # without sudo on Windows +``` This installs two files: - `/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 configuration: - - meson x --buildtype release --strip -Db_lto=true \ - -Dprebuilt_server=/path/to/scrcpy-server.jar - cd x - ninja - sudo ninja install - +```bash +$ meson x --buildtype release --strip -Db_lto=true \ + -Dprebuilt_server=/path/to/scrcpy-server.jar +$ cd x +$ ninja +$ sudo ninja install +``` ## Run _At runtime, `adb` must be accessible from your `PATH`._ If everything is ok, just plug an Android device, and execute: - - scrcpy - +```bash +$ scrcpy +``` It accepts command-line arguments, listed by: - - scrcpy --help - +```bash +$ scrcpy --help +``` For example, to decrease video bitrate to 2Mbps (default is 8Mbps): - - scrcpy -b 2M - +```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): - - scrcpy -m 1024 - +```bash +$ scrcpy -m 1024 +``` If several devices are listed in `adb devices`, you must specify the _serial_: - - scrcpy -s 0123456789abcdef - +```bash +$ scrcpy -s 0123456789abcdef +``` To run without installing: - - ./run x [options] - +```bash +$ ./run x [options] +``` (where `x` is your build directory). From 8476b4aab81c0591d1ed52404090a7f4f245eee7 Mon Sep 17 00:00:00 2001 From: Siddharth Dushantha Date: Sat, 10 Mar 2018 15:34:59 +0100 Subject: [PATCH 2/3] removed "$" and changed Mac OS ---> MacOS --- README.md | 66 +++++++++++++++++++++++++++---------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index b1702521..49fd5b0e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This application provides display and control of Android devices connected on USB. It does not require any _root_ access. It works on _GNU/Linux_, _Windows_ -and _Mac OS_. +and _MacOS_. ![screenshot](assets/screenshot-debian-600.jpg) @@ -40,12 +40,12 @@ 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 +sudo apt install ffmpeg libsdl2-2.0.0 # build dependencies -$ sudo apt install make gcc openjdk-8-jdk pkg-config meson zip \ - libavcodec-dev libavformat-dev libavutil-dev \ -                 libsdl2-dev +sudo apt install make gcc openjdk-8-jdk pkg-config meson zip \ + libavcodec-dev libavformat-dev libavutil-dev \ +                 libsdl2-dev ``` #### Windows @@ -66,20 +66,20 @@ 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 +pacman -S mingw-w64-x86_64-SDL2 \ + mingw-w64-x86_64-ffmpeg # build dependencies -$ pacman -S mingw-w64-x86_64-make \ - mingw-w64-x86_64-gcc \ - mingw-w64-x86_64-pkg-config \ - mingw-w64-x86_64-meson \ -           zip +pacman -S mingw-w64-x86_64-make \ + mingw-w64-x86_64-gcc \ + 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" +export PATH="$JAVA_HOME/bin:$PATH" ``` #### Mac OS @@ -89,15 +89,15 @@ Use [Homebrew] to install the packages: [Homebrew]: https://brew.sh/ ```bash # runtime dependencies -$ brew install sdl2 ffmpeg +brew install sdl2 ffmpeg # 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, 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 @@ -107,21 +107,21 @@ its directory. For example: [Android SDK]: https://developer.android.com/studio/index.html ```bash -$ export ANDROID_HOME=~/android/sdk +export ANDROID_HOME=~/android/sdk ``` Then, build `scrcpy`: ```bash -$ meson x --buildtype release --strip -Db_lto=true -$ cd x -$ ninja +meson x --buildtype release --strip -Db_lto=true +cd x +ninja ``` You can test it from here: ```bash -$ ninja run +ninja 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: @@ -147,11 +147,11 @@ 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 +meson x --buildtype release --strip -Db_lto=true \ + -Dprebuilt_server=/path/to/scrcpy-server.jar +cd x +ninja +sudo ninja install ``` ## Run @@ -160,28 +160,28 @@ _At runtime, `adb` must be accessible from your `PATH`._ If everything is ok, just plug an Android device, and execute: ```bash -$ scrcpy +scrcpy ``` It accepts command-line arguments, listed by: ```bash -$ scrcpy --help +scrcpy --help ``` 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 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_: ```bash -$ scrcpy -s 0123456789abcdef +scrcpy -s 0123456789abcdef ``` To run without installing: ```bash -$ ./run x [options] +./run x [options] ``` (where `x` is your build directory). From cc4a0152567d0c7e007de140089fa0e5e139d417 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Sat, 10 Mar 2018 16:24:03 +0100 Subject: [PATCH 3/3] Add empty lines around code blocks And fix spaces (do not randomly use non-breaking spaces for indentation). --- README.md | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 49fd5b0e..5c2601fb 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ The client requires _FFmpeg_ and _LibSDL2_. #### Linux Install the required packages from your package manager (here, for Debian): + ```bash # runtime dependencies sudo apt install ffmpeg libsdl2-2.0.0 @@ -45,7 +46,7 @@ sudo apt install ffmpeg libsdl2-2.0.0 # build dependencies sudo 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 the project. From an MSYS2 terminal, install the required packages: [MSYS2]: http://www.msys2.org/ + ```bash # runtime dependencies pacman -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`: + ```bash export 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 dependencies brew install sdl2 ffmpeg @@ -94,8 +99,10 @@ 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" ``` @@ -106,23 +113,31 @@ Install the [Android SDK] (_Android Studio_), and set `ANDROID_HOME` to 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 +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 Meson configuration: + ```bash meson 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: + ```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).