Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not list ADB devices ,But I can use 'adb shell' normally #5001

Open
2 tasks done
C1heck0ut opened this issue Jun 19, 2024 · 14 comments
Open
2 tasks done

Could not list ADB devices ,But I can use 'adb shell' normally #5001

C1heck0ut opened this issue Jun 19, 2024 · 14 comments

Comments

@C1heck0ut
Copy link

C1heck0ut commented Jun 19, 2024

  • I have read the FAQ.
  • I have searched in existing issues.

Environment

  • OS: Windows
  • scrcpy version: 2.4
  • installation method: Windows release
  • device model:google pixel xl
  • Android version: 10

Describe the bug
When I use scrcpy, it reports an error ERROR: Could not list ADB devices ERROR: Server connection failed. I have deleted the windows environment variables. When I use the adb that comes with scrcpy, it returns List of devices attached HT68A0201096 device, and I can use adb shell to operate

@C1heck0ut
Copy link
Author

It was working fine a few days ago.

@Holdmyhand
Copy link

Same issues here.
image
Previously used normally, may there have been issues with Win11 updates?

@JaxonDozier7
Copy link

Try downloading scrcpy again.

@Holdmyhand
Copy link

Try downloading scrcpy again.

I used 2.4 before, and 2.5 in the picture was just downloaded

@rom1v
Copy link
Collaborator

rom1v commented Jul 2, 2024

@Holdmyhand I would need the raw output of adb devices -l. Could you please execute:

adb devices -l > output.txt

Then post the output.txt file (as a file).

Thank you.

@C1heck0ut Please post the output of adb devices -l.

@Holdmyhand
Copy link

Holdmyhand commented Jul 2, 2024

@Holdmyhand I would need the raw output of adb devices -l. Could you please execute:

adb devices -l > output.txt

Then post the output.txt file (as a file).

Thank you.

@C1heck0ut Please post the output of adb devices -l.

OK,I executed this command, but it seems that the output.txt I received is empty.

Microsoft Windows [版本 10.0.22621.3737]
(c) Microsoft Corporation。保留所有权利。

D:\scrcpy-win64-v2.5>adb devices -l
List of devices attached
a1d918ec               device product:raphael model:Redmi_K20_Pro_Premium_Edition device:raphael transport_id:1


D:\scrcpy-win64-v2.5>adb devices -l > output.txt

D:\scrcpy-win64-v2.5>type output.txt

D:\scrcpy-win64-v2.5>adb devices -l >> output.txt

D:\scrcpy-win64-v2.5>type output.txt

D:\scrcpy-win64-v2.5>adb version
Android Debug Bridge version 1.0.41
Version 35.0.0-11411520
Installed as D:\scrcpy-win64-v2.5\adb.exe
Running on Windows 10.0.22621

D:\scrcpy-win64-v2.5>

image

@rom1v
Copy link
Collaborator

rom1v commented Jul 2, 2024

I executed this command, but it seems that the output.txt I received is empty.

OK, that's the problem then: when its output is captured, it produces no output (so when scrcpy executes adb devices -l, it receives nothing).

I could not reproduce, adb devices -l > output.txt always writes the output to output.txt.

Since the official adb.exe (which is provided in the scrcpy release) does not behave that way, I think something on your system messed it up (maybe some antivirus or other buggy "security" tool?)

Just to be sure, check that your binaries are correct:

certUtil -hashfile adb.exe SHA256
certUtil -hashfile AdbWinApi.dll SHA256
certUtil -hashfile AdbWinUsbApi.dll SHA256

Here are the expected sha256sums for the v2.5 release:

997324a38d89e3b282306bf25ccaa167c49a35850ac0ab4a169e7a15afa82fc8  adb.exe
1ad523231de449af3ba0e8664d3af332f0c5cc4f09141691ca05e35368fa811a  AdbWinApi.dll
51a61758a6f1f13dd36530199c0d65e227cd9d43765372b2942944cc3296ca2c  AdbWinUsbApi.dll

@rom1v
Copy link
Collaborator

rom1v commented Jul 2, 2024

Does echo "hello" > output.txt work?

Related: https://exiftool.org/forum/index.php?topic=5848.0

@Holdmyhand
Copy link

Does echo "hello" > output.txt works? 

Related: https://exiftool.org/forum/index.php?topic=5848.0

I have verified and compared these files, and the hash value is correct. Use echo works fine.

Microsoft Windows [版本 10.0.22621.3737]
(c) Microsoft Corporation。保留所有权利。

D:\scrcpy-win64-v2.5>certUtil -hashfile adb.exe SHA256
SHA256 的 adb.exe 哈希:
997324a38d89e3b282306bf25ccaa167c49a35850ac0ab4a169e7a15afa82fc8
CertUtil: -hashfile 命令成功完成。

D:\scrcpy-win64-v2.5>certUtil -hashfile AdbWinApi.dll SHA256
SHA256 的 AdbWinApi.dll 哈希:
1ad523231de449af3ba0e8664d3af332f0c5cc4f09141691ca05e35368fa811a
CertUtil: -hashfile 命令成功完成。

D:\scrcpy-win64-v2.5>certUtil -hashfile AdbWinUsbApi.dll SHA256
SHA256 的 AdbWinUsbApi.dll 哈希:
51a61758a6f1f13dd36530199c0d65e227cd9d43765372b2942944cc3296ca2c
CertUtil: -hashfile 命令成功完成。

D:\scrcpy-win64-v2.5>echo "hello" > output.txt

D:\scrcpy-win64-v2.5>type output.txt
"hello"

D:\scrcpy-win64-v2.5>

I closed the antivirus software and tried using Powershell and Terminal Administrator again, but the adb output redirection still gives empty file.

@rom1v
Copy link
Collaborator

rom1v commented Jul 2, 2024

In this comment, the user suggests a workaround: from your cmd.exe, try running cmd.exe, then run adb device -l > output.txt from that second terminal.

@Holdmyhand
Copy link

In this comment, the user suggests a workaround: from your cmd.exe, try running cmd.exe, then run adb device -l > output.txt from that second terminal.

Still empty.Funning Win11, it should be a Windows issue. Thank you very much for your patient explanation.

@rom1v
Copy link
Collaborator

rom1v commented Jul 2, 2024

Refs #3386 #3534

@C1heck0ut
Copy link
Author

@rom1v ok,I tried using adb devices -l > output.txt, and the output was List of devices attached HT68A0201096 device product:marlin model:Pixel_XL device:marlin transport_id:10

@C1heck0ut
Copy link
Author

@rom1v Then I used the 2.5 version of scrcpy, and the output showed scrcpy 2.5 <https://github.com/Genymobile/scrcpy> INFO: ADB device found: INFO: --> (usb) HT68A0201096 device Pixel_XL E:\android_re\scrcpy-win64-v2.5\scrcpy-server: 1 file pushed, 0 skipped. 162.9 MB/s (69624 bytes in 0.000s) [server] INFO: Device: [Google] google Pixel XL (Android 10) [server] WARN: Audio disabled: it is not supported before Android 11 INFO: Renderer: direct3d WARN: Demuxer 'audio': stream explicitly disabled by the device ERROR: Demuxer 'video': stream disabled due to connection error ERROR: Controller error Segmentation fault

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants