I started using scrcpy on Windows and recently switched to Ubuntu, where it worked beautifully as well. I had some issues while getting used to Ubuntu and had to fiddle around a bit, reinstalling it twice. After the first time, scrcpy refused to work but after a few attempts, the "Allow USB debugging" pop-up opened on my phone, I authorized the PC and it worked again.
After another reinstall, it now refuses to work again and whatever I try, it doesn't seem to trigger "Allow USB" (I can get it to open with "adb devices" though).
No matter what I do, I always get this result:
> * daemon not running; starting now at tcp:5037
> ADB server didn't ACK
> Full server startup log: /tmp/adb.1000.log
> Server had pid: 7405
> --- adb starting (pid 7405) ---
> adb I 05-27 21:42:55 7405 7405 main.cpp:57] Android Debug Bridge version 1.0.39
> adb I 05-27 21:42:55 7405 7405 main.cpp:57] Version 1:8.1.0+r23-5~18.04
> adb I 05-27 21:42:55 7405 7405 main.cpp:57] Installed as /snap/scrcpy/46/usr/lib/android-sdk/platform-tools/adb
> adb I 05-27 21:42:55 7405 7405 main.cpp:57]
> error: could not install *smartsocket* listener: Permission denied
>
> * failed to start daemon
> adb: error: failed to get feature set: cannot connect to daemon
> ERROR: "adb push" returned with value 1
Any idea what I could try to get it to work again? I have tried multiple combinations of reinstalls, reboots etc. already.
It's related to the snap package.
@sisco311 Any idea?
So I tried to install it manually following this page's instructions. When running "ninja", I got
syrus î‚° pop-os î‚° ~/scrcpy/x î‚° ninja
[1/1] Generating scrcpy-server with a custom command.
FAILED: server/scrcpy-server.jar
/home/syrus/scrcpy/server/./scripts/build-wrapper.sh ../server/. server/scrcpy-server.jar release
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':server'.
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
ninja: build stopped: subcommand failed.
Is this related to the above issue? If not, just ignore it.
Use the prebuilt server if you don't have the Android SDK.
First check if the snap is installed correctly and any plugs are connected:
snap info scrcpy
snap connections
Next try to kill any instances of adb:
scrcpy.adb kill-servershould do the trick. But if you have installed adb form a different source and you started it as another user or root you may have to kill it as root:
sudo killall adb
The next step is to check if any process is listening on port 5037:
lsof -i :5037
If nothing is listening on port 5037 and adb is not running, then start the server in debug mode:
ADB_TRACE=all scrcpy.adb start-server
Hopefully the output of the above commands will shed some light on the situation.
Well, before doing anything else, I tried just running scrcpy again. This time, it triggered the popup on the phone but now I get:
adb: error: cannot stat '/usr/local/share/scrcpy/scrcpy-server.jar': No such file or directory
ERROR: "adb push" returned with value 1
Then I tried all your suggestions:
snap info scrcpy
name: scrcpy
summary: Display and control your Android device
publisher: sisco311
contact: https://github.com/sisco311/scrcpy-snap/issues
license: Apache-2.0
description: |
This application provides display and control of Android devices connected
on USB (or over TCP/IP). It does not require any root access. It works on
GNU/Linux, Windows and MacOS.
This is an unofficial snap. The code of scrcpy can be found at:
https://github.com/Genymobile/scrcpy
commands:
- scrcpy.adb
- scrcpy
snap-id: M7yvgnqOvyQj64bolfpawIAEwHv7dQ5G
tracking: stable
refresh-date: today at 21:48 CEST
channels:
stable: v1.8 2019-05-07 (46) 83MB -
candidate: ↑
beta: ↑
edge: v1.8-21-g5d473ef 2019-05-27 (70) 83MB -
installed: v1.8 (46) 83MB -
snap connections
did nothing at all
sudo scrcpy.adb kill-server
cannot connect to daemon at tcp:5037: Permission denied
lsof -i :5037
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
adb 9282 syrus 6u IPv4 342210 0t0 TCP localhost:5037 (LISTEN)
ADB_TRACE=all scrcpy.adb start-server
adb I 05-28 21:54:36 9653 9653 adb_trace.cpp:178] Android Debug Bridge version 1.0.39
adb I 05-28 21:54:36 9653 9653 adb_trace.cpp:178] Version 1:8.1.0+r23-5~18.04
adb I 05-28 21:54:36 9653 9653 adb_trace.cpp:178] Installed as /snap/scrcpy/46/usr/lib/android-sdk/platform-tools/adb
adb I 05-28 21:54:36 9653 9653 adb_trace.cpp:178]
adb I 05-28 21:54:36 9653 9653 adb_client.cpp:139] _adb_connect: host:version
adb I 05-28 21:54:36 9653 9653 adb_client.cpp:196] adb_connect: service host:start-server
* daemon not running; starting now at tcp:5037
adb I 05-28 21:54:36 9667 9667 adb_trace.cpp:178] Android Debug Bridge version 1.0.39
adb I 05-28 21:54:36 9667 9667 adb_trace.cpp:178] Version 1:8.1.0+r23-5~18.04
adb I 05-28 21:54:36 9667 9667 adb_trace.cpp:178] Installed as /snap/scrcpy/46/usr/lib/android-sdk/platform-tools/adb
adb I 05-28 21:54:36 9667 9667 adb_trace.cpp:178]
ADB server didn't ACK
Full server startup log: /tmp/adb.1000.log
Server had pid: 9667
--- adb starting (pid 9667) ---
adb I 05-28 21:54:36 9667 9667 main.cpp:57] Android Debug Bridge version 1.0.39
adb I 05-28 21:54:36 9667 9667 main.cpp:57] Version 1:8.1.0+r23-5~18.04
adb I 05-28 21:54:36 9667 9667 main.cpp:57] Installed as /snap/scrcpy/46/usr/lib/android-sdk/platform-tools/adb
adb I 05-28 21:54:36 9667 9667 main.cpp:57]
adb I 05-28 21:54:36 9667 9667 transport.cpp:573] socketpair: (3,5)
adb I 05-28 21:54:36 9667 9667 fdevent.cpp:158] fdevent_install (fdevent 5 A)
adb I 05-28 21:54:36 9667 9667 fdevent.cpp:204] fdevent_set: (fdevent 5 AR), events = 1
adb I 05-28 21:54:36 9667 9667 transport_local.cpp:427] transport: local client init
adb I 05-28 21:54:36 9667 9667 fdevent.cpp:163] fdevent_remove (fdevent 0 )
adb I 05-28 21:54:36 9667 9668 usb_linux.cpp:583] Created device thread
adb I 05-28 21:54:36 9667 9669 transport_local.cpp:204] transport: client_socket_thread() starting
adb I 05-28 21:54:36 9667 9667 fdevent.cpp:163] fdevent_remove (fdevent 0 )
adb I 05-28 21:54:36 9667 9667 fdevent.cpp:163] fdevent_remove (fdevent 0 )
adb I 05-28 21:54:36 9667 9667 fdevent.cpp:163] fdevent_remove (fdevent 0 )
adb I 05-28 21:54:36 9667 9667 fdevent.cpp:163] fdevent_remove (fdevent 0 )
adb I 05-28 21:54:36 9667 9667 fdevent.cpp:163] fdevent_remove (fdevent 0 )
error: could not install *smartsocket* listener: Permission denied
* failed to start daemon
error: cannot connect to daemon
Normally the snap automatically connects to a number of slots at installation time. Not sure what happened in your case.
Try:
sudo snap install core
sudo snap connect scrcpy:adb-support :adb-support
sudo snap connect scrcpy:x11 :x11
sudo snap connect scrcpy:desktop :desktop
sudo snap connect scrcpy:desktop-legacy :desktop-legacy
sudo snap connect scrcpy:network :network
sudo snap connect scrcpy:wayland :wayland
Update: It works now.
After the previous different error, I downloaded the *.jar, created a new folder and moved it there.
Unfortunately, I have no clue what happened to the previous error and what solved (?) it. Its disappearance doesn't seem to correlate to anything I did.
Anyway, thanks a lot for your help to the both of you. I'm really glad it's working again now.
Thank you for the update. So I'm closing. Feel free to reopen if necessary.
I have the same problem with snap. The only way to solve this is to build myself?
Edit: Have to correct myself. After following the instructions here everything is good to go.
@sisco311 The version v1.9 would not build correctly due to a confusion about the "portable" flag, you need to include some further commits (typically, point at least to 53310a925a495f61d42dd90faa0a0748074d63c5). But since it seems you don't specify any tag (https://github.com/sisco311/scrcpy-snap/commit/14d8e882e9ada6cdbf46647775b7befae94e8177), I don't know which version is packaged on snap.
Anyway, it could explain the problem @chilliger encounter.
@rom1v see my edit above
@chilliger Great, then :+1:
I'm using 53310a9 for the stable channel(v1.9).
https://github.com/sisco311/scrcpy-snap/commit/eb8ae48c1c30d00cd20b3f0053b0608e90dbe2ad