From 82ee55845cb22eb54a5173579e4abe0513a92efb Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Sun, 4 Feb 2018 12:17:34 +0100 Subject: [PATCH] Add "make run" To run the app during development, add a recipe "run" to the Makefile. --- Makefile | 9 +++++++-- README.md | 25 ++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index b7639e4b..5edc098e 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: default release clean build-app build-server dist dist-zip sums test +.PHONY: default release clean build build-app build-server run dist dist-zip sums test GRADLE ?= ./gradlew @@ -25,7 +25,12 @@ build-app: build-server: $(GRADLE) assembleRelease -dist: build-server build-app +build: build-app build-server + +run: + SCRCPY_SERVER_JAR=server/build/outputs/apk/release/server-release-unsigned.apk $(APP_BUILD_DIR)/scrcpy $(ARGS) + +dist: build mkdir -p "$(DIST)/$(TARGET_DIR)" # no need to sign the APK, we dont "install" it, this is in fact a simple jar cp server/build/outputs/apk/release/server-release-unsigned.apk "$(DIST)/$(TARGET_DIR)/scrcpy-server.jar" diff --git a/README.md b/README.md index 532ceec3..bfd3f2e7 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ from the `PATH`: export PATH="$JAVA_HOME/bin:$PATH" -### Generate +### Build Make sure your `ANDROID_HOME` variable is set to your Android SDK directory: @@ -91,9 +91,17 @@ Make sure your `ANDROID_HOME` variable is set to your Android SDK directory: From the project root directory, execute: - make release + make build -This will generate the application in `dist/scrcpy/`. +To run the build: + + make run + +It is also pass arguments to `scrcpy` via `make`: + + make run ARGS="-p 1234" + +The purpose of this command is to execute `scrcpy` during the development. ### Test @@ -107,6 +115,15 @@ The server-side tests require JUnit 4: sudo apt install junit4 +### Generate a release + +From the project root directory, execute: + + make release + +This will generate the application in `dist/scrcpy/`. + + ## Run Plug a device, and from `dist/scrcpy/`, execute: @@ -120,3 +137,5 @@ If several devices are listed in `adb devices`, you must specify the _serial_: To change the default port (useful to launch several `scrcpy` simultaneously): ./scrcpy -p 1234 + +Other options are available, check `scrcpy --help`.