Clarify the order of operations in BUILD.md
PR #2223 <https://github.com/Genymobile/scrcpy/pull/2223> Signed-off-by: Romain Vimont <rom@rom1v.com>
This commit is contained in:
parent
fda293f9bb
commit
fc5de88eaa
1 changed files with 42 additions and 40 deletions
82
BUILD.md
82
BUILD.md
|
@ -2,11 +2,6 @@
|
||||||
|
|
||||||
Here are the instructions to build _scrcpy_ (client and server).
|
Here are the instructions to build _scrcpy_ (client and server).
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
## Branches
|
## Branches
|
||||||
|
|
||||||
|
@ -188,8 +183,27 @@ See [pierlon/scrcpy-docker](https://github.com/pierlon/scrcpy-docker).
|
||||||
|
|
||||||
## Common steps
|
## Common steps
|
||||||
|
|
||||||
If you want to build the server, install the [Android SDK] (_Android Studio_),
|
**As a non-root user**, clone the project:
|
||||||
and set `ANDROID_SDK_ROOT` to its directory. For example:
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/Genymobile/scrcpy
|
||||||
|
cd scrcpy
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Build
|
||||||
|
|
||||||
|
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]: #option-2-use-prebuilt-server
|
||||||
|
|
||||||
|
|
||||||
|
#### Option 1: Build everything from sources
|
||||||
|
|
||||||
|
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
|
[Android SDK]: https://developer.android.com/studio/index.html
|
||||||
|
|
||||||
|
@ -202,20 +216,11 @@ export ANDROID_SDK_ROOT=~/Library/Android/sdk
|
||||||
set ANDROID_SDK_ROOT=%LOCALAPPDATA%\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:
|
Then, build:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
meson x --buildtype release --strip -Db_lto=true
|
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
|
_Note: `ninja` [must][ninja-user] be run as a non-root user (only `ninja
|
||||||
|
@ -224,9 +229,27 @@ install` must be run as root)._
|
||||||
[ninja-user]: https://github.com/Genymobile/scrcpy/commit/4c49b27e9f6be02b8e63b508b60535426bd0291a
|
[ninja-user]: https://github.com/Genymobile/scrcpy/commit/4c49b27e9f6be02b8e63b508b60535426bd0291a
|
||||||
|
|
||||||
|
|
||||||
### Run
|
#### Option 2: Use prebuilt server
|
||||||
|
|
||||||
To run without installing:
|
- [`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 # DO NOT RUN AS ROOT
|
||||||
|
```
|
||||||
|
|
||||||
|
The server only works with a matching client version (this server works with the
|
||||||
|
`master` branch).
|
||||||
|
|
||||||
|
|
||||||
|
### Run without installing:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./run x [options]
|
./run x [options]
|
||||||
|
@ -249,24 +272,3 @@ This installs two files:
|
||||||
Just remove them to "uninstall" the application.
|
Just remove them to "uninstall" the application.
|
||||||
|
|
||||||
You can then [run](README.md#run) _scrcpy_.
|
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).
|
|
||||||
|
|
Loading…
Reference in a new issue