Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
111.98k stars 10.71k forks source link

adb: error: failed to read copy response #3241

Open alyssadev opened 2 years ago

alyssadev commented 2 years ago

Environment

Describe the bug Sometimes scrcpy seems unable to negotiate the connection, and breaks usb debugging in the process. Disconnecting and reconnecting the phone presents the devices in adb devices again, but it seems to be random whether running scrcpy will cause usb debugging to stop working again.

# using scrcpy as normal, then device suddenly disconnects
[aly@ads-desktop ~]$ scrcpy
scrcpy 1.23 <https://github.com/Genymobile/scrcpy>
/usr/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 213.6 MB/s (41123 bytes in 0.000s)
[server] INFO: Device: samsung SM-N960F (Android 10)
INFO: Renderer: opengl
INFO: OpenGL version: 4.6.0 NVIDIA 510.60.02
INFO: Trilinear filtering enabled
INFO: Initial texture: 2216x1080
WARN: Device disconnected

# attempting to reconnect
[aly@ads-desktop ~]$ scrcpy
scrcpy 1.23 <https://github.com/Genymobile/scrcpy>
/usr/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 279.8 MB/s (41123 bytes in 0.000s)
adb: error: failed to read copy response
ERROR: "adb push" returned with value 1
ERROR: Server connection failed

[aly@ads-desktop ~]$ scrcpy
scrcpy 1.23 <https://github.com/Genymobile/scrcpy>
ERROR: Could not find any ADB device
ERROR: Server connection failed

[aly@ads-desktop ~]$ adb devices
List of devices attached
28cda4b224027ece    device

[aly@ads-desktop ~]$ scrcpy -V verbose
scrcpy 1.23 <https://github.com/Genymobile/scrcpy>
DEBUG: ADB device found:
DEBUG:     -->   (usb)  28cda4b224027ece                device  SM_N960F
DEBUG: Device serial: 28cda4b224027ece
DEBUG: Using server: /usr/share/scrcpy/scrcpy-server
/usr/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 165.4 MB/s (41123 bytes in 0.000s)
adb: error: failed to read copy response
ERROR: "adb push" returned with value 1
ERROR: Server connection failed

[aly@ads-desktop ~]$ scrcpy -V verbose
scrcpy 1.23 <https://github.com/Genymobile/scrcpy>
ERROR: Could not find any ADB device
ERROR: Server connection failed

[aly@ads-desktop ~]$ adb devices
List of devices attached

[aly@ads-desktop ~]$
alyssadev commented 2 years ago

Just had it get a little bit further, it successfully connected but then lost connection immediately

[aly@ads-desktop ~]$ scrcpy -V verbose
scrcpy 1.23 <https://github.com/Genymobile/scrcpy>
DEBUG: ADB device found:
DEBUG:     -->   (usb)  28cda4b224027ece                device  SM_N960F
DEBUG: Device serial: 28cda4b224027ece
DEBUG: Using server: /usr/share/scrcpy/scrcpy-server
/usr/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 230.5 MB/s (41123 bytes in 0.000s)
[server] INFO: Device: samsung SM-N960F (Android 10)
DEBUG: Server connected
DEBUG: Starting controller thread
DEBUG: Starting receiver thread
[server] DEBUG: Using encoder: 'OMX.Exynos.AVC.Encoder'
INFO: Renderer: opengl
INFO: OpenGL version: 4.6.0 NVIDIA 510.60.02
INFO: Trilinear filtering enabled
DEBUG: Using icon: /usr/share/icons/hicolor/256x256/apps/scrcpy.png
INFO: Initial texture: 1080x2216
DEBUG: Starting demuxer thread
DEBUG: Receiver stopped
DEBUG: End of frames
WARN: Device disconnected
DEBUG: quit...
DEBUG: Server disconnected
DEBUG: Server terminated
[aly@ads-desktop ~]$ adb devices
List of devices attached

[aly@ads-desktop ~]$ scrcpy -V verbose
scrcpy 1.23 <https://github.com/Genymobile/scrcpy>
ERROR: Could not find any ADB device
ERROR: Server connection failed
[aly@ads-desktop ~]$
rom1v commented 2 years ago

You should try with another USB cable/port: https://github.com/Genymobile/scrcpy/blob/master/FAQ.md#device-disconnected

If this does not fix the problem, might be a bug in the ROM (try with another device to confirm).

felipecastrosales commented 1 year ago

News about it?

Krzeszny commented 1 year ago

I had the same error on regular ADB, no additional apps. I still don't know why, but it worked fine on a different computer.

artem-zinnatullin commented 1 year ago

If cable unplug/plug helps — try replacing the cable with another and maybe try another port on computer. Or you can try something completely different to eliminate cable issue — ADB over Wi-Fi https://developer.android.com/tools/adb#connect-to-a-device-over-wi-fi

And if you’re using a USB-C hub, sometimes they’re problematic if they don’t have enough power or bandwidth if you run say 4k monitor through it.

Hope that helps.

rapilkim commented 1 year ago

I had the same error while my colleague's PC did not have the error. Finally, I found that one security policy of the company on my PC was different with him. It was mobile storage write permission. After getting the permission, no error shown anymore. If you use a company PC, check a security policy on it.

realyukii commented 2 months ago

I think this is not an issue of scrcpy, adb from platform-tools of android studio also have same issue.

but even though the adb output show an error, the file sent successfully without corrupt

realyukii commented 2 months ago

after the adb push error, now my devices state switched to offline, hmmm that's weird

shiyeling commented 1 month ago

I'm having same issue here. If I copy file to device, it reports: adb: error: failed to read copy response

And if I install directly, it fails and the device become offline.

ilsubyeega commented 1 week ago

Just used a cable with better bandwidth and it worked.

Originally I had a 100W usb 2.0, but I switched to a 60W 10Gbps cable and it worked. Things like adb shell work, I don't know why only scrcpy doesn't, I thought it would work as far as audio forwarding but not video.