You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
adb: error: cannot stat 'scrcpy-server.jar': No such file or directory #567
hi
when i start scrcpy from a process with administrator privileges i get this error
adb: error: cannot stat 'scrcpy-server.jar': No such file or directory
i dont now how to add full path in the env variable SCRCPY_SERVER_PATH !!!
thanks
If you launch scrcpy from its own directory (either by typing scrcpy from that directory in a terminal, or by double-clicking on scrcpy.exe from your file browser), it should work as is (unless you set SCRCPY_SERVER_PATH to a wrong value). To make it work, just unset that environment variable, and retry (start a new terminal after you unset it).
If instead you added the scrcpy directory in your PATH, and try to launch scrcpy from another directory, then you need to set SCRCPY_SERVER_PATH to the full path of the jar file (e.g. C:\Users\h1n1\scrcpy\scrcpy-server.jar).
@rom1v
im lunching scrcpy from a process with administrator privileges
this is way he well not see service.jar this is why i sugest to add a agrs to scrcpy newer version
set path well not resolve the problem at all...
I also get this error on Ubuntu, where scrcpy looks in /usr/local/bin/scrcpy-server.jar (scrcpy's install directory) instead of /usr/local/share/scrcpy/scrcpy-server.jar.
@rom1v using the official v1.9 tag, both if manually passing -Dportable=false or applying the fix in 53310a9 I still get a failure during build with the following message.
In file included from ../scrcpy-1.9/app/src/server.c:12:
../scrcpy-1.9/app/src/server.c: In function ‘get_server_path’:
../scrcpy-1.9/app/src/server.c:18:53: error: expected ‘)’ before ‘SERVER_FLENAME’
#define DEFAULT_SERVER_PATH PREFIX "/share/scrcpy/" SERVER_FLENAME
^~~~~~~~~~~~~~
../scrcpy-1.9/app/src/log.h:7:62: note: in definition of macro ‘LOGD’
#define LOGD(...) SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__)
^~~~~~~~~~~
../scrcpy-1.9/app/src/server.c:31:27: note: in expansion of macro ‘DEFAULT_SERVER_PATH’
LOGD("Using server: " DEFAULT_SERVER_PATH);
^~~~~~~~~~~~~~~~~~~
../scrcpy-1.9/app/src/server.c:18:53: error: expected ‘;’ before ‘SERVER_FLENAME’
#define DEFAULT_SERVER_PATH PREFIX "/share/scrcpy/" SERVER_FLENAME
^~~~~~~~~~~~~~
../scrcpy-1.9/app/src/server.c:33:12: note: in expansion of macro ‘DEFAULT_SERVER_PATH’
return DEFAULT_SERVER_PATH;
^~~~~~~~~~~~~~~~~~~
I'm a bit rusty with C, but from what I remember, using #define to declare a macro, accepts only 1 parameter, so server.c at lines 18 and 19 look wrong to me:
I'm a bit rusty with C, but from what I remember, using #define to declare a macro, accepts only 1 parameter, so server.c at lines 18 and 19 look wrong to me
In C, you can concatenate string literals by just writing them one after the other:
Activity
npes87184 commentedon May 31, 2019
Hi, @H1-N1
What's your operating system?
Thanks.
rom1v commentedon May 31, 2019
Many people are annoyed on Windows with this problem.
The cause is that it looks for
scrcpy-server.jarin the current directory (.), not the same directory asscrcpy.exe: #278 (comment)We should change that for Windows: if
SCRCPY_SERVER_PATHis not set, then we need to use the directory ofscrcpy, then appendscrcpy-server.jar. Ref: https://stackoverflow.com/questions/2647429/c-windows-path-to-the-folder-where-the-executable-is-located/2647446#2647446H1-N1 commentedon May 31, 2019
Windows @npes87184
H1-N1 commentedon May 31, 2019
@rom1v or just add args that take care of server path
Becose i allready set SCRCPY_SERVER_PATH but I get the same error
Thanks for you replay guys
rom1v commentedon May 31, 2019
@H1-N1 What did you do exactly?
Here is how it works.
If you launch
scrcpyfrom its own directory (either by typingscrcpyfrom that directory in a terminal, or by double-clicking onscrcpy.exefrom your file browser), it should work as is (unless you setSCRCPY_SERVER_PATHto a wrong value). To make it work, just unset that environment variable, and retry (start a new terminal after you unset it).If instead you added the
scrcpydirectory in yourPATH, and try to launchscrcpyfrom another directory, then you need to setSCRCPY_SERVER_PATHto the full path of the jar file (e.g.C:\Users\h1n1\scrcpy\scrcpy-server.jar).H1-N1 commentedon Jun 1, 2019
@rom1v
im lunching scrcpy from a process with administrator privileges
this is way he well not see service.jar this is why i sugest to add a agrs to scrcpy newer version
set path well not resolve the problem at all...
rom1v commentedon Jun 1, 2019
From which directory do you start
scrcpy? (which is your current directory and what command do you enter?)What is the exact value assigned to your
SCRCPY_SERVER_PATH? Is it defined for your system (not only your user)?iw0nderhow commentedon Jun 12, 2019
I also get this error on Ubuntu, where scrcpy looks in
/usr/local/bin/scrcpy-server.jar(scrcpy's install directory) instead of/usr/local/share/scrcpy/scrcpy-server.jar.rom1v commentedon Jun 12, 2019
@Karottenbaum If you
git clone/git pullthis morning, please update to current master.There was an issue: 53310a9.
iw0nderhow commentedon Jun 12, 2019
Thanks, it's working with that commit. Sorry for the trouble!
hrk commentedon Jun 24, 2019
@rom1v using the official v1.9 tag, both if manually passing -Dportable=false or applying the fix in 53310a9 I still get a failure during build with the following message.
I'm a bit rusty with C, but from what I remember, using #define to declare a macro, accepts only 1 parameter, so server.c at lines 18 and 19 look wrong to me:
and the ninja build fails due to this. Am I missing something?
rom1v commentedon Jun 24, 2019
@hrk You also need the commit before: bcd0a87.
In C, you can concatenate string literals by just writing them one after the other:
This is what the macro does.
hrk commentedon Jun 24, 2019
Wow, didn't know about that. And didn't notice the spelling mistake. :) Thank you, it's working now.
rom1v commentedon Jun 24, 2019
v1.9 fixes the problem by searching in the same directory as the binary on Windows, so I'm closing.
Add option to change the background color