When I start
$ react-native run-android
the react native server use the same ADB as SCRCPY and it shut down my screen mirror, and if I run the scrcpy.exe it shut down the the connection over react-native and my device.
How I can the 2 services without conflict?
Use the same adb version for both.
You can specify a custom adb path for scrcpy by setting the ADB environment variable:
ADB=/path/to/adb scrcpy
You can specify a custom
adbpath for scrcpy by setting theADBenvironment variable:ADB=/path/to/adb scrcpyPlease add this to readme
Hi, @Plandercozeron
It is great and free for opening a PR, if you think it is a good thing!
Thanks.
You're right, I just added it: https://github.com/Genymobile/scrcpy/blob/master/README.md#custom-paths
when i run ABD=/path/to/adb, this happens
[/media/expertsofts/01D29959D09B3F60/Linux_Programs/Android/Sdk/platform-tools/adb], [push], [/usr/local/share/scrcpy/scrcpy-server.jar], [/data/local/tmp/scrcpy-server.jar]
ERROR: Could not execute "adb push"
What if you execute the command manually:
/media/expertsofts/01D29959D09B3F60/Linux_Programs/Android/Sdk/platform-tools/adb push /usr/local/share/scrcpy/scrcpy-server.jar /data/local/tmp/scrcpy-server.jar
?
What if you execute the command manually:
/media/expertsofts/01D29959D09B3F60/Linux_Programs/Android/Sdk/platform-tools/adb push /usr/local/share/scrcpy/scrcpy-server.jar /data/local/tmp/scrcpy-server.jar?
I get thsi error
adb: error: failed to read all of '/usr/local/share/scrcpy/scrcpy-server.jar': Permission denied
/usr/local/share/scrcpy/scrcpy-server.jar: 0 files pushed.
FYI. There was no directory like /usr/local/share/scrcpy. I copied contents from /snap/scrcpy/127/usr/local/share/scrcpy/scrcpy-server.jar and pasted over there and set up SCRCPY_SERVER (or so) path manually.
Sorry. I ran that command with sudo and it executed but the problem is still there. When i run scrcpy, i still get
adb server version (41) doesn't match this client (39); killing...
There seems to be two instances of adb running
See https://github.com/Genymobile/scrcpy/issues/599#issuecomment-503904290.
I ran that command with sudo
(you should not do that)
Hey..
I changed the environment variable to ADB=/path/to/adb and it works perfect..
But what I am wondering about is why the environment variable should execute
scrcpy in my case it couldn't find this command and so I used only ADB=/path/to/adb
and as I said it works
-> Is there any reason for executing scrcpy
Thank you ^^
On which system?
On _bash_ (typically on Linux), VAR1=value1 VAR2=value2 executable executes executable with the modified environment.
I use windows 10
Then do it in two steps: set the environment variable, then execute scrcpy.
Yeah, I've done it this way before... -> in windows is no need for executing scrcpy in the environment variable..
If anyone else has problems, this is how I managed to make it work:
adb --version
Android Debug Bridge version 1.0.41
Version 30.0.2-6538114
Installed as /home/chris/Android/Sdk/platform-tools/adb
ADB=/home/chris/Android/Sdk/platform-tools/adb scrcpynote1: my which adb returns /usr/bin/adb and that did not work
note2: if you connection drops problems from react-native side, run adb reverse tcp:8081 tcp:8081
Most helpful comment