diff --git a/BUILD.md b/BUILD.md index fdcc569d..ca6e778d 100644 --- a/BUILD.md +++ b/BUILD.md @@ -6,7 +6,7 @@ You may want to build only the client: the server binary, which will be pushed to the Android device, does not depend on your system and architecture. In that case, use the [prebuilt server] (so you will not need Java or the Android SDK). -[prebuilt server]: #prebuilt-server +[prebuilt server]: #option-2-prebuilt-server ## Branches @@ -189,7 +189,18 @@ See [pierlon/scrcpy-docker](https://github.com/pierlon/scrcpy-docker). ## Common steps -If you want to build the server, install the [Android SDK] (_Android Studio_), +**As a non-root user**, Clone the project: + +```bash +git clone https://github.com/Genymobile/scrcpy +cd scrcpy +``` + +If you don't want to build the server, use the [Prebuilt server]. + +### Option 1: If you want to build the server + +Install the [Android SDK] (_Android Studio_), and set `ANDROID_SDK_ROOT` to its directory. For example: [Android SDK]: https://developer.android.com/studio/index.html @@ -203,20 +214,11 @@ export ANDROID_SDK_ROOT=~/Library/Android/sdk set ANDROID_SDK_ROOT=%LOCALAPPDATA%\Android\sdk ``` -If you don't want to build the server, use the [prebuilt server]. - -Clone the project: - -```bash -git clone https://github.com/Genymobile/scrcpy -cd scrcpy -``` - Then, build: ```bash meson x --buildtype release --strip -Db_lto=true -ninja -Cx +ninja -Cx # DO NOT RUN AS ROOT ``` _Note: `ninja` [must][ninja-user] be run as a non-root user (only `ninja @@ -225,34 +227,7 @@ install` must be run as root)._ [ninja-user]: https://github.com/Genymobile/scrcpy/commit/4c49b27e9f6be02b8e63b508b60535426bd0291a -### Run - -To run without installing: - -```bash -./run x [options] -``` - - -### Install - -After a successful build, you can install _scrcpy_ on the system: - -```bash -sudo ninja -Cx install # without sudo on Windows -``` - -This installs two files: - - - `/usr/local/bin/scrcpy` - - `/usr/local/share/scrcpy/scrcpy-server` - -Just remove them to "uninstall" the application. - -You can then [run](README.md#run) _scrcpy_. - - -## Prebuilt server +### Option 2: Prebuilt server - [`scrcpy-server-v1.17`][direct-scrcpy-server] _(SHA-256: 11b5ad2d1bc9b9730fb7254a78efd71a8ff46b1938ff468e47a21b653a1b6725_ @@ -271,3 +246,26 @@ sudo ninja -Cx install The server only works with a matching client version (this server works with the `master` branch). + +### Run without installing: + +```bash +./run x [options] +``` + +### Install + +After a successful build, you can install _scrcpy_ on the system: + +```bash +sudo ninja -Cx install # without sudo on Windows +``` + +This installs two files: + + - `/usr/local/bin/scrcpy` + - `/usr/local/share/scrcpy/scrcpy-server` + +Just remove them to "uninstall" the application. + +You can then [run](README.md#run) _scrcpy_.