Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
110.23k stars 10.57k forks source link

scrcpy doen't start #651

Closed JakobDev closed 5 years ago

JakobDev commented 5 years ago

If I run scrcpy I get the following error:

adb server version (32) doesn't match this client (39); killing...
* daemon started successfully
adb: error: failed to get feature set: no devices/emulators found
ERROR: "adb push" returned with value 1

adb works on my PC. If I run e.g. adb shell I can enter the shell of my Smartphone without problems. File transfer works too.

rom1v commented 5 years ago
adb server version (32) doesn't match this client (39); killing...

You have 2 adb running on your pc. One is very old (32). You should find the app which uses it.

If you run several apps which use adb, then they must use the exact same version. For example, you could replace the binary of the old one.

Note that scrcpy can use any adb by providing its full path in the ADB environment variable.

JakobDev commented 5 years ago

I'vde downloaded adb now from https://developer.android.com/studio/releases/platform-tools.html. I have unpacked it and I had ran export ADB="/home/jakob/Programme/platform-tools/adb". Now I get the following error:

adb: error: failed to get feature set: no devices/emulators found
ERROR: "adb push" returned with value 1

I use the snap Version in Ubuntu 16.04.

rom1v commented 5 years ago

cc @sisco311 :wink:

sisco311 commented 5 years ago

The builtin adb starts correctly, but does not detect your phone. Please post the vendor id of the device: lsusb

JakobDev commented 5 years ago

The Output of lsusb:

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 004: ID 174f:1169 Syntek 
Bus 002 Device 006: ID 0bc2:231a Seagate RSS LLC 
Bus 002 Device 005: ID 1c10:1c17 Lanterra Industrial Co., Ltd. 
Bus 002 Device 010: ID 2e04:c026  
Bus 002 Device 003: ID 05e3:0605 Genesys Logic, Inc. USB 2.0 Hub
Bus 002 Device 002: ID 1c4f:0054 SiGma Micro 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

It's a Nokia 6.1 with Android 9.

sisco311 commented 5 years ago

See: scrcpy-snap issues 4

Your phone is not on the list of trusted devices by the adb-support interface. As a fix you can create a udev rule for the phone.

JakobDev commented 5 years ago

Is there any template for the udev rule?

rom1v commented 5 years ago

@sisco311 I'm not sure this is the best practice, but it is possible to allow all usb devices by not filtering by devideId and productId:

SUBSYSTEM=="usb", MODE="0666", GROUP="plugdev"
sisco311 commented 5 years ago

@JakobDev there is one in the link I posted. I'm on my phone. Can't paste it here.

@rom1v the udev rule needs a special tag to work. As I said therevis an example in the link I posted.

rom1v commented 5 years ago

@sisco311 Ok, what I meant was to remove ATTR{idVendor}=="XXXX" from the rule (so that is applies to all vendor ids). But it's probably a bit "naughty".

JakobDev commented 5 years ago

I have now created the file /etc/udev/rules.d/99-nokia-61.rules with the following content:

SUBSYSTEM=="usb", ATTR{idVendor}=="2e04:c026", TAG+="snap_scrcpy_adb"
SUBSYSTEM=="usb", ATTR{idVendor}=="2e04:c026", TAG+="snap_scrcpy_scrcpy"

And I have executed all command to reload from the post, but it still does not work.

rom1v commented 5 years ago

Replace 2e04:c026 by 2e04.

JakobDev commented 5 years ago

Thta workd now! Thanks!

btw: Can you make a PR for snap that adds Nokia 6.1 to the supported devices?