Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the order of operations #2223

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
70 changes: 34 additions & 36 deletions BUILD.md
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -225,14 +227,31 @@ install` must be run as root)._
[ninja-user]: https://github.com/Genymobile/scrcpy/commit/4c49b27e9f6be02b8e63b508b60535426bd0291a


### Run
### Option 2: Prebuilt server

- [`scrcpy-server-v1.17`][direct-scrcpy-server]
_(SHA-256: 11b5ad2d1bc9b9730fb7254a78efd71a8ff46b1938ff468e47a21b653a1b6725_

[direct-scrcpy-server]: https://github.com/Genymobile/scrcpy/releases/download/v1.17/scrcpy-server-v1.17

To run without installing:
Download the prebuilt server somewhere, and specify its path during the Meson
configuration:

```bash
./run x [options]
meson x --buildtype release --strip -Db_lto=true \
-Dprebuilt_server=/path/to/scrcpy-server
ninja -Cx
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

Expand All @@ -250,24 +269,3 @@ This installs two files:
Just remove them to "uninstall" the application.

You can then [run](README.md#run) _scrcpy_.


## Prebuilt server

- [`scrcpy-server-v1.17`][direct-scrcpy-server]
_(SHA-256: 11b5ad2d1bc9b9730fb7254a78efd71a8ff46b1938ff468e47a21b653a1b6725_

[direct-scrcpy-server]: https://github.com/Genymobile/scrcpy/releases/download/v1.17/scrcpy-server-v1.17

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
ninja -Cx
sudo ninja -Cx install
```

The server only works with a matching client version (this server works with the
`master` branch).