Open GitDreak opened 2 years ago
adb devices -l
echo ℅ADB℅
?
C:\Users\Administrator>adb devices -l List of devices attached c3edc532 device product:lmipro model:Redmi_K30_Pro_Zoom_Edition device:lmipro transport_id:1
C:\Users\Administrator>echo ℅ADB℅ ℅ADB℅
List of devices attached c3edc532 device product:lmipro model:Redmi_K30_Pro_Zoom_Edition device:lmipro transport_id:1
This output parses correctly, so you should not get ERROR: Could not list ADB devices
.
Are you absolutely sure that your device was detected when you executed scrcpy -d
?
Does it also happen without -d
?
Yes, because I tried to kill the service and restart it, whether USB debugging is allowed for the mobile phone also appears。 Try the above methods and enter adb devices,The terminal can also see the c3edc532 device However, this problem still occurs when enter the code scrcpy and scrcpy - d again
C:\Users\Administrator>adb kill-server
C:\Users\Administrator>adb start-server
C:\Users\Administrator>adb devices List of devices attached c3edc532 device
C:\Users\Administrator>scrcpy scrcpy 1.24 https://github.com/Genymobile/scrcpy ERROR: Could not list ADB devices ERROR: Server connection failed
C:\Users\Administrator>scrcpy -d scrcpy 1.24 https://github.com/Genymobile/scrcpy ERROR: Could not list ADB devices ERROR: Server connection failed
Oh, it seems the same as #3386.
Yes, I also looked at this #3386 question and saw that you said it might be an OS related permissions issue. I'm not sure if it's the problem caused by the update before win11, because scrcpy can be used normally before the win11 update.
If there is a problem in scrcpy (something that may cause the reading of the output of a process fail on some Windows systems under some conditions), it's in this function: https://github.com/Genymobile/scrcpy/blob/72ba913324d65cded8672dca7a57415cb82da095/app/src/sys/win/process.c#L26-L216
Sorry, my current programming level is not high enough to understand this. Today I tried to update to the latest version of win11, but the problem still exists. Is there any other solution please?
Please try this binary (replace the file in your 1.24 release), which prints more logs (based on https://github.com/Genymobile/scrcpy/issues/3386#issuecomment-1188877907 but with additional logs):
scrcpy.exe
SHA-256: 606b1ffea768070a15e699808caf22b955f4a8f0bb51a86e7f7d7a3dce1bbb02
C:\Users\Administrator>scrcpy scrcpy 1.24 https://github.com/Genymobile/scrcpy INFO: sc_pipe_read() returned -1 when copied=0 INFO: sc_pipe_read_all() returns -1 INFO: sc_pipe_read_all_intr() returned -1 ERROR: Could not list ADB devices ERROR: Server connection failed
C:\Users\Administrator>scrcpy -d scrcpy 1.24 https://github.com/Genymobile/scrcpy INFO: sc_pipe_read() returned -1 when copied=0 INFO: sc_pipe_read_all() returns -1 INFO: sc_pipe_read_all_intr() returned -1 ERROR: Could not list ADB devices ERROR: Server connection failed
One more test, please. Here is another binary with an additional log:
scrcpy.exe
SHA-256: 23683ba6a4955669a9d181921faecbd1bbae6fa08f0e0a5fefcb2642114264cf
C:\Users\Administrator>scrcpy scrcpy 1.24 https://github.com/Genymobile/scrcpy ERROR: ReadFile error: 109 INFO: sc_pipe_read() returned -1 when copied=0 INFO: sc_pipe_read_all() returns -1 INFO: sc_pipe_read_all_intr() returned -1 ERROR: Could not list ADB devices ERROR: Server connection failed
C:\Users\Administrator>scrcpy -d scrcpy 1.24 https://github.com/Genymobile/scrcpy ERROR: ReadFile error: 109 INFO: sc_pipe_read() returned -1 when copied=0 INFO: sc_pipe_read_all() returns -1 INFO: sc_pipe_read_all_intr() returned -1 ERROR: Could not list ADB devices ERROR: Server connection failed
OK, thanks, so the pipe is not valid when read:
ERROR: ReadFile error: 109
ERROR_BROKEN_PIPE 109 (0x6D) The pipe has been ended.
https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-
To be investigated.
@npes87184 Maybe you might have any idea about the cause? It happens only on Windows, only on very few machines apparently (this problem which totally prevents scrcpy to work has been reported only twice). Maybe scrcpy does something wrong when starting a process on Windows, but I don't understand.
Sorry for the late reply. I am quite busy recently.
I will take a look #2932 and this issue when I have free time (maybe after 10/22 😵).
I'm seeing same exact issue, on an Android device running 5.1. It's weird because I have ~6 of these devices I've been testing with today, and this issue only occurs on 2 of the 6. And these two came from a specific manufacturing run we did a year or so ago.
Not sure what or how to check, but I'm wondering if there is some sort of flag or permission issue that could cause this associated with a manufacturers specific kernel build?
@CameronBanga This specific issue ("Could not list ADB devices" while adb devices -l
actually lists the device) is definitely a client-side issue, so it should not depend on the device.
Could you reproduce the problem with always the same devices? Or is it random? (in that case, that could be a race condition, e.g. if the adb
process terminates before reading its output)
@rom1v so far with what I have seen, the device is connected and recognized by ADB without issue. Here's a sample output of adb devices -l
List of devices attached
GS101200400611 device usb:17825792X product:rk3288 model:rk3288 device:rk3288 transport_id:15
Out of the devices that I have, I have 4 that seem to always connect to scrcpy reliably, and 2 that refuse to connect. The devices are all identical (same size, same Android 5.1, same manufacturer), the only distinguishing difference is that the 2 that refuse to connect are from a specific manufacturing run of the tablets. The other 4 that connect are from other manufacturing runs.
The only distinguishing difference is that the 2 that refuse to connect are from a specific manufacturing run of the tablets
What is the full scrcpy output when you connect one of these devices? And what is the output of adb devices -l
for these ones? (is it the output in your previous comment?)
It is the output of previous comment, so this is what I see:
⇒ adb devices -l
List of devices attached
GS101200400611 device usb:17825792X product:rk3288 model:rk3288 device:rk3288 transport_id:15
And here is what is see from scrcpy
:
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
2022-10-14 13:53:35.075 scrcpy[10883:119447] ERROR: Could not find any ADB device
2022-10-14 13:53:35.432 scrcpy[10883:119446] ERROR: Server connection failed
If it helps, I'm on macOS 12.6, installed via homebrew.
⇒ adb devices -l
List of devices attached
GS101200400611 device usb:17825792X product:rk3288 model:rk3288 device:rk3288 transport_id:15
Oh, your problem is a different one: the device serial starts with a space, so it is ignored by the parser (or at least is reported with a printed space by adb devices -l
).
Which one works:
adb -s GS101200400611 shell echo ok
adb -s ' GS101200400611' shell echo ok
?
Just to confirm this is not the same issue, test with this executable and post the logs: https://github.com/Genymobile/scrcpy/issues/3534#issuecomment-1278678694
@rom1v Ah, good catch, it is the space:
Desktop|⇒ adb -s GS101200400611 shell echo ok
adb: device 'GS101200400611' not found
Desktop|⇒ adb -s ' GS101200400611' shell echo ok
ok
That executable looks to be an exe. Have a Mac compatible executable I could try?
OK, could you please open a separate issue for serials containing a space please? I'll fix it before the next release.
I have the same situation: My pc:
Here are my log:
C:\Users\Jade\Documents\software\scrcpy>adb devices -l
List of devices attached
8f2e78ed device product:raphael model:Redmi_K20_Pro_Premium_Edition device:raphael transport_id:9
run the first debug exe https://github.com/Genymobile/scrcpy/issues/3534#issuecomment-1278586443
C:\Users\Jade\Documents\software\scrcpy>scrcpy -d
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
INFO: sc_pipe_read() returned -1 when copied=0
INFO: sc_pipe_read_all() returns -1
INFO: sc_pipe_read_all_intr() returned -1
ERROR: Could not list ADB devices
ERROR: Server connection failed
run the second debug exe
C:\Users\Jade\Documents\software\scrcpy>scrcpy -d
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
ERROR: ReadFile error: 109
INFO: sc_pipe_read() returned -1 when copied=0
INFO: sc_pipe_read_all() returns -1
INFO: sc_pipe_read_all_intr() returned -1
ERROR: Could not list ADB devices
ERROR: Server connection failed
My systeminfo
AdminPasswordStatus : 0
BootupState : Normal boot
ChassisBootupState : 2
KeyboardPasswordStatus : 2
PowerOnPasswordStatus : 2
PowerSupplyState : 2
PowerState : 0
FrontPanelResetStatus : 2
ThermalState : 2
Status : OK
Name : DESKTOP-OFONCHJ
PowerManagementCapabilities :
PowerManagementSupported :
Caption : DESKTOP-OFONCHJ
Description : AT/AT COMPATIBLE
InstallDate :
CreationClassName : Win32_ComputerSystem
NameFormat :
PrimaryOwnerContact :
PrimaryOwnerName : Jade
Roles : {LM_Workstation, LM_Server, NT}
InitialLoadInfo :
LastLoadInfo :
ResetCapability : 1
AutomaticManagedPagefile : True
AutomaticResetBootOption : True
AutomaticResetCapability : True
BootOptionOnLimit :
BootOptionOnWatchDog :
BootROMSupported : True
BootStatus :
ChassisSKUNumber :
CurrentTimeZone : 480
DaylightInEffect :
DNSHostName : DESKTOP-OFONCHJ
Domain : WORKGROUP
DomainRole : 0
EnableDaylightSavingsTime : True
HypervisorPresent : False
InfraredSupported : False
Manufacturer : Microsoft Corporation
Model : Surface Laptop
NetworkServerModeEnabled : True
NumberOfLogicalProcessors : 4
NumberOfProcessors : 1
OEMLogoBitmap :
OEMStringArray :
PartOfDomain : False
PauseAfterReset : -1
PCSystemType : 2
PCSystemTypeEx : 2
ResetCount : -1
ResetLimit : -1
SupportContactDescription :
SystemFamily : Surface
SystemSKUNumber : Surface_Laptop
SystemStartupDelay :
SystemStartupOptions :
SystemStartupSetting :
SystemType : x64-based PC
TotalPhysicalMemory : 17092952064
UserName : DESKTOP-OFONCHJ\Jade
WakeUpType : 2
Workgroup : WORKGROUP
PSComputerName :
CimClass : root/cimv2:Win32_ComputerSystem
CimInstanceProperties : {Caption, Description, InstallDate, Name...}
CimSystemProperties : Microsoft.Management.Infrastructure.CimSystemProperties
Environment
OS: window11 scrcpy version: 1.24 device model: Redmi K30 Pro Zoom Edition Android version: 12/13 Describe the bug: Hello, the author. It was normal to use scrcpy before, but it can't be used normally these days. What's the reason? scrcpy -d prompts an error