Display and control your Android device
Rename scrcpy-server.jar to scrcpy-server
Romain Vimont3da95b52bd21
diff --git a/BUILD.md b/BUILD.mdindex 475580f8..161f8f92 100644--- a/BUILD.md+++ b/BUILD.md@@ -225,7 +225,7 @@ sudo ninja install # without sudo on WindowsThis installs two files:- `/usr/local/bin/scrcpy`- - `/usr/local/share/scrcpy/scrcpy-server.jar`+ - `/usr/local/share/scrcpy/scrcpy-server`Just remove them to "uninstall" the application.@@ -244,7 +244,7 @@ configuration:```bashmeson x --buildtype release --strip -Db_lto=true \- -Dprebuilt_server=/path/to/scrcpy-server.jar+ -Dprebuilt_server=/path/to/scrcpy-servercd xninjasudo ninja installdiff --git a/DEVELOP.md b/DEVELOP.mdindex dea8137d..fb8ab91d 100644--- a/DEVELOP.md+++ b/DEVELOP.md@@ -3,7 +3,7 @@## OverviewThis application is composed of two parts:- - the server (`scrcpy-server.jar`), to be executed on the device,+ - the server (`scrcpy-server`), to be executed on the device,- the client (the `scrcpy` binary), executed on the host computer.The client is responsible to push the server to the device and start its@@ -49,7 +49,7 @@ application may not replace the server just before the client executes it._Instead of a raw _dex_ file, `app_process` accepts a _jar_ containing`classes.dex` (e.g. an [APK]). For simplicity, and to benefit from the gradlebuild system, the server is built to an (unsigned) APK (renamed to-`scrcpy-server.jar`).+`scrcpy-server`).[dex]: https://en.wikipedia.org/wiki/Dalvik_(software)[apk]: https://en.wikipedia.org/wiki/Android_application_packagediff --git a/Makefile.CrossWindows b/Makefile.CrossWindowsindex c07cb24f..59f5a302 100644--- a/Makefile.CrossWindows+++ b/Makefile.CrossWindows@@ -3,7 +3,7 @@## Here, "portable" means that the client and server binaries are expected to be# anywhere, but in the same directory, instead of well-defined separate-# locations (e.g. /usr/bin/scrcpy and /usr/share/scrcpy/scrcpy-server.jar).+# locations (e.g. /usr/bin/scrcpy and /usr/share/scrcpy/scrcpy-server).## In particular, this implies to change the location from where the client push# the server to the device.@@ -97,7 +97,7 @@ build-win64-noconsole: prepare-deps-win64dist-win32: build-server build-win32 build-win32-noconsolemkdir -p "$(DIST)/$(WIN32_TARGET_DIR)"- cp "$(SERVER_BUILD_DIR)"/server/scrcpy-server.jar "$(DIST)/$(WIN32_TARGET_DIR)/"+ cp "$(SERVER_BUILD_DIR)"/server/scrcpy-server "$(DIST)/$(WIN32_TARGET_DIR)/"cp "$(WIN32_BUILD_DIR)"/app/scrcpy.exe "$(DIST)/$(WIN32_TARGET_DIR)/"cp "$(WIN32_NOCONSOLE_BUILD_DIR)"/app/scrcpy.exe "$(DIST)/$(WIN32_TARGET_DIR)/scrcpy-noconsole.exe"cp prebuilt-deps/ffmpeg-4.1.4-win32-shared/bin/avutil-56.dll "$(DIST)/$(WIN32_TARGET_DIR)/"@@ -112,7 +112,7 @@ dist-win32: build-server build-win32 build-win32-noconsoledist-win64: build-server build-win64 build-win64-noconsolemkdir -p "$(DIST)/$(WIN64_TARGET_DIR)"- cp "$(SERVER_BUILD_DIR)"/server/scrcpy-server.jar "$(DIST)/$(WIN64_TARGET_DIR)/"+ cp "$(SERVER_BUILD_DIR)"/server/scrcpy-server "$(DIST)/$(WIN64_TARGET_DIR)/"cp "$(WIN64_BUILD_DIR)"/app/scrcpy.exe "$(DIST)/$(WIN64_TARGET_DIR)/"cp "$(WIN64_NOCONSOLE_BUILD_DIR)"/app/scrcpy.exe "$(DIST)/$(WIN64_TARGET_DIR)/scrcpy-noconsole.exe"cp prebuilt-deps/ffmpeg-4.1.4-win64-shared/bin/avutil-56.dll "$(DIST)/$(WIN64_TARGET_DIR)/"diff --git a/README.md b/README.mdindex f698cb4c..ebf593a1 100644--- a/README.md+++ b/README.md@@ -358,7 +358,7 @@ To use a specific _adb_ binary, configure its path in the environment variableADB=/path/to/adb scrcpy-To override the path of the `scrcpy-server.jar` file, configure its path in+To override the path of the `scrcpy-server` file, configure its path in`SCRCPY_SERVER_PATH`.[useful]: https://github.com/Genymobile/scrcpy/issues/278#issuecomment-429330345diff --git a/app/meson.build b/app/meson.buildindex ccd05fee..5d24fb3a 100644--- a/app/meson.build+++ b/app/meson.build@@ -93,7 +93,7 @@ conf.set_quoted('SCRCPY_VERSION', meson.project_version())# the prefix used during configuration (meson --prefix=PREFIX)conf.set_quoted('PREFIX', get_option('prefix'))-# build a "portable" version (with scrcpy-server.jar accessible from the same+# build a "portable" version (with scrcpy-server accessible from the same# directory as the executable)conf.set('PORTABLE', get_option('portable'))diff --git a/app/src/server.c b/app/src/server.cindex 85b1b6b8..4fe65402 100644--- a/app/src/server.c+++ b/app/src/server.c@@ -13,7 +13,7 @@#include "net.h"#define SOCKET_NAME "scrcpy"-#define SERVER_FILENAME "scrcpy-server.jar"+#define SERVER_FILENAME "scrcpy-server"#define DEFAULT_SERVER_PATH PREFIX "/share/scrcpy/" SERVER_FILENAME#define DEVICE_SERVER_PATH "/data/local/tmp/" SERVER_FILENAME@@ -32,7 +32,7 @@ get_server_path(void) {// the absolute path is hardcodedreturn DEFAULT_SERVER_PATH;#else- // use scrcpy-server.jar in the same directory as the executable+ // use scrcpy-server in the same directory as the executablechar *executable_path = get_executable_path();if (!executable_path) {LOGE("Could not get executable path, "diff --git a/meson_options.txt b/meson_options.txtindex d93161e3..84889597 100644--- a/meson_options.txt+++ b/meson_options.txt@@ -3,5 +3,5 @@ option('compile_server', type: 'boolean', value: true, description: 'Build the soption('crossbuild_windows', type: 'boolean', value: false, description: 'Build for Windows from Linux')option('windows_noconsole', type: 'boolean', value: false, description: 'Disable console on Windows (pass -mwindows flag)')option('prebuilt_server', type: 'string', description: 'Path of the prebuilt server')-option('portable', type: 'boolean', value: false, description: 'Use scrcpy-server.jar from the same directory as the scrcpy executable')+option('portable', type: 'boolean', value: false, description: 'Use scrcpy-server from the same directory as the scrcpy executable')option('hidpi_support', type: 'boolean', value: true, description: 'Enable High DPI support')diff --git a/release.sh b/release.shindex fbd1eb54..4c5afbf1 100755--- a/release.sh+++ b/release.sh@@ -23,21 +23,21 @@ cd -make -f Makefile.CrossWindows# the generated server must be the same everywhere-cmp "$BUILDDIR/server/scrcpy-server.jar" dist/scrcpy-win32/scrcpy-server.jar-cmp "$BUILDDIR/server/scrcpy-server.jar" dist/scrcpy-win64/scrcpy-server.jar+cmp "$BUILDDIR/server/scrcpy-server" dist/scrcpy-win32/scrcpy-server+cmp "$BUILDDIR/server/scrcpy-server" dist/scrcpy-win64/scrcpy-server# get version nameTAG=$(git describe --tags --always)# create release directorymkdir -p "release-$TAG"-cp "$BUILDDIR/server/scrcpy-server.jar" "release-$TAG/scrcpy-server-$TAG.jar"+cp "$BUILDDIR/server/scrcpy-server" "release-$TAG/scrcpy-server-$TAG"cp "dist/scrcpy-win32-$TAG.zip" "release-$TAG/"cp "dist/scrcpy-win64-$TAG.zip" "release-$TAG/"# generate checksumscd "release-$TAG"-sha256sum "scrcpy-server-$TAG.jar" \+sha256sum "scrcpy-server-$TAG" \"scrcpy-win32-$TAG.zip" \"scrcpy-win64-$TAG.zip" > SHA256SUMS.txtdiff --git a/run b/runindex 7abeca05..bfb499ae 100755--- a/run+++ b/run@@ -20,4 +20,4 @@ thenexit 1fi-SCRCPY_SERVER_PATH="$BUILDDIR/server/scrcpy-server.jar" "$BUILDDIR/app/scrcpy" "$@"+SCRCPY_SERVER_PATH="$BUILDDIR/server/scrcpy-server" "$BUILDDIR/app/scrcpy" "$@"diff --git a/scripts/run-scrcpy.sh b/scripts/run-scrcpy.shindex fa6d7c8f..f3130ee9 100755--- a/scripts/run-scrcpy.sh+++ b/scripts/run-scrcpy.sh@@ -1,2 +1,2 @@#!/bin/bash-SCRCPY_SERVER_PATH="$MESON_BUILD_ROOT/server/scrcpy-server.jar" "$MESON_BUILD_ROOT/app/scrcpy"+SCRCPY_SERVER_PATH="$MESON_BUILD_ROOT/server/scrcpy-server" "$MESON_BUILD_ROOT/app/scrcpy"diff --git a/server/build_without_gradle.sh b/server/build_without_gradle.shindex 5f2eff22..daf85008 100755--- a/server/build_without_gradle.sh+++ b/server/build_without_gradle.sh@@ -17,7 +17,7 @@ BUILD_TOOLS=${ANDROID_BUILD_TOOLS:-29.0.2}BUILD_DIR="$(realpath ${BUILD_DIR:-build_manual})"CLASSES_DIR="$BUILD_DIR/classes"SERVER_DIR=$(dirname "$0")-SERVER_BINARY=scrcpy-server.jar+SERVER_BINARY=scrcpy-serverecho "Platform: android-$PLATFORM"echo "Build-tools: $BUILD_TOOLS"@@ -59,4 +59,4 @@ cd "$BUILD_DIR"jar cvf "$SERVER_BINARY" classes.dexrm -rf classes.dex classes-echo "Server generated in $BUILD_DIR/scrcpy-server.jar"+echo "Server generated in $BUILD_DIR/$SERVER_BINARY"diff --git a/server/meson.build b/server/meson.buildindex 43901246..4ba481d5 100644--- a/server/meson.build+++ b/server/meson.build@@ -4,7 +4,7 @@ prebuilt_server = get_option('prebuilt_server')if prebuilt_server == ''custom_target('scrcpy-server',build_always: true, # gradle is responsible for tracking source changes- output: 'scrcpy-server.jar',+ output: 'scrcpy-server',command: [find_program('./scripts/build-wrapper.sh'), meson.current_source_dir(), '@OUTPUT@', get_option('buildtype')],console: true,install: true,@@ -16,7 +16,7 @@ elseendifcustom_target('scrcpy-server-prebuilt',input: prebuilt_server,- output: 'scrcpy-server.jar',+ output: 'scrcpy-server',command: ['cp', '@INPUT@', '@OUTPUT@'],install: true,install_dir: 'share/scrcpy')diff --git a/server/src/main/java/com/genymobile/scrcpy/Server.java b/server/src/main/java/com/genymobile/scrcpy/Server.javaindex 3bd2fcdc..eba89bdb 100644--- a/server/src/main/java/com/genymobile/scrcpy/Server.java+++ b/server/src/main/java/com/genymobile/scrcpy/Server.java@@ -7,7 +7,7 @@ import java.io.IOException;public final class Server {- private static final String SERVER_PATH = "/data/local/tmp/scrcpy-server.jar";+ private static final String SERVER_PATH = "/data/local/tmp/scrcpy-server";private Server() {// not instantiable