diff --git a/docker/Real_device b/docker/Real_device index 8c3c3f4..8b0ca10 100644 --- a/docker/Real_device +++ b/docker/Real_device @@ -69,9 +69,38 @@ RUN apt-get -qqy update && apt-get -qqy install --no-install-recommends \ net-tools \ ffmpeg \ jq \ + curl \ + libavcodec-dev \ + libavformat-dev \ + libavutil-dev \ + gcc \ + git \ + make \ + meson \ + musl-dev \ + pkgconf \ + libsdl2-dev \ && apt clean all \ && rm -rf /var/lib/apt/lists/* + +#=========== +# scrcpy - screen copy +# https://github.com/Genymobile/scrcpy +#=========== +ARG SCRCPY_VER=1.10 +ARG SERVER_HASH="cbeb1a4e046f1392c1dc73c3ccffd7f86dec4636b505556ea20929687a119390" + +RUN mkdir /root/scrcpy +RUN curl -L -o /root/scrcpy/scrcpy-code.zip https://github.com/Genymobile/scrcpy/archive/v${SCRCPY_VER}.zip +RUN curl -L -o /root/scrcpy/scrcpy-server.jar https://github.com/Genymobile/scrcpy/releases/download/v${SCRCPY_VER}/scrcpy-server-v${SCRCPY_VER}.jar +RUN echo "$SERVER_HASH scrcpy/scrcpy-server.jar" | sha256sum -c - +RUN cd scrcpy && unzip -x scrcpy-code.zip +RUN cd scrcpy/scrcpy-${SCRCPY_VER} && meson x --buildtype release --strip -Db_lto=true -Dprebuilt_server=/root/scrcpy/scrcpy-server.jar +RUN cd scrcpy/scrcpy-${SCRCPY_VER}/x && ninja && ninja install +RUN rm -rf scrcpy/ + + #=========== # Polyverse # https://polyverse.io/how-it-works/ @@ -156,7 +185,6 @@ EXPOSE 4723 6080 5555 #=================== # Run docker-appium #=================== -COPY sm/asm.jar /root/ COPY src /root/src COPY supervisord.conf /root/ RUN chmod -R +x /root/src && chmod +x /root/supervisord.conf diff --git a/sm/asm.jar b/sm/asm.jar deleted file mode 100755 index 295053b..0000000 Binary files a/sm/asm.jar and /dev/null differ diff --git a/src/asm.sh b/src/scrcpy.sh similarity index 53% rename from src/asm.sh rename to src/scrcpy.sh index 8641b58..0aaa861 100644 --- a/src/asm.sh +++ b/src/scrcpy.sh @@ -3,6 +3,6 @@ if [ -z "$REAL_DEVICE"]; then echo "Container is using android emulator" else - echo "Starting android screen mirror..." - java -jar /root/asm.jar $ANDROID_HOME + echo "Starting android screen copy..." + /usr/local/bin/scrcpy fi diff --git a/supervisord.conf b/supervisord.conf index ccdcfbb..4f3693f 100644 --- a/supervisord.conf +++ b/supervisord.conf @@ -35,12 +35,12 @@ autorestart=false priority=1 ;startsecs to fix "not expected" error. see: https://github.com/Supervisor/supervisor/issues/212#issuecomment-47933372 -[program:android-screen-mirror] -command=./src/asm.sh -autorestart=false +[program:screen-copy] +command=./src/scrcpy.sh +autorestart=true startsecs=0 -stdout_logfile=%(ENV_LOG_PATH)s/android-screen-mirror.stdout.log -stderr_logfile=%(ENV_LOG_PATH)s/android-screen-mirror.stderr.log +stdout_logfile=%(ENV_LOG_PATH)s/screen-copy.stdout.log +stderr_logfile=%(ENV_LOG_PATH)s/screen-copy.stderr.log priority=3 [program:atd]