py-android-viewer icon indicating copy to clipboard operation
py-android-viewer copied to clipboard

start scrcpy-server.jar error

Open bzqyzzld opened this issue 4 years ago • 3 comments

cmd

adb shell CLASSPATH=/data/local/tmp/scrcpy-server.jar app_process /com.genymobile.scrcpy.Server 0 8000000 true

error info

[server] ERROR: Exception on thread Thread[main,5,main]
java.lang.IllegalArgumentException: The server version (0) does not match the client (1.12.1)
        at com.genymobile.scrcpy.Server.createOptions(Server.java:78)
        at com.genymobile.scrcpy.Server.main(Server.java:162)
        at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:388)

bzqyzzld avatar Sep 22 '20 02:09 bzqyzzld

Hey @bzqyzzld If you check the code you will see how script is running the server

[self.adb_path, 'shell',
                 'CLASSPATH=/data/local/tmp/scrcpy-server.jar',
                 'app_process', '/', 'com.genymobile.scrcpy.Server 1.12.1 {} {} {} true - false true'.format(
                    max_width, bitrate, max_fps)]

So the right way is: CLASSPATH=/data/local/tmp/scrcpy-server.jar app_process / com.genymobile.scrcpy.Server 1.12.1 1024 8000000 25 true - false true

razumeiko avatar Sep 22 '20 05:09 razumeiko

I tried to download scrcpy-server with the version 1.16 and renamed scrcpy-server.jar when i run the commands:adb shell CLASSPATH=/data/local/tmp/scrcpy-server.jar app_process / com.genymobile.scrcpy.Server 1.16 1024 8000000 25 true - false true error infos:

D:\soft\scrcpy>adb shell CLASSPATH=/data/local/tmp/scrcpy-server.jar app_process
 / com.genymobile.scrcpy.Server 1.16 1024 8000000 25 true - false true
[server] ERROR: Exception on thread Thread[main,5,main]
java.lang.IllegalArgumentException: Expecting 14 parameters
        at com.genymobile.scrcpy.Server.createOptions(Server.java:125)
        at com.genymobile.scrcpy.Server.main(Server.java:221)
        at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:251)

bzqyzzld avatar Sep 24 '20 09:09 bzqyzzld

@bzqyzzld why do you need to change server? Server arguments can change from version to version and i am not author of this Java server, i took this server from https://github.com/Genymobile/scrcpy as i mention in project description. So you could use the server which is presented in this repo or you can try to read original server code and see what should be changed. Your error saying that it's expecting 14 parameters, so i guess something wrong with order or number of params.

razumeiko avatar Sep 24 '20 10:09 razumeiko