scrcpy icon indicating copy to clipboard operation
scrcpy copied to clipboard

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

Open C1heck0ut opened this issue 1 year ago • 1 comments

  • [x] I have read the FAQ.
  • [x] 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 avatar Jun 19 '24 02:06 C1heck0ut

It was working fine a few days ago.

C1heck0ut avatar Jun 19 '24 02:06 C1heck0ut

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

Holdmyhand avatar Jul 02 '24 07:07 Holdmyhand

Try downloading scrcpy again.

JaxonDozier7 avatar Jul 02 '24 08:07 JaxonDozier7

Try downloading scrcpy again.

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

Holdmyhand avatar Jul 02 '24 08:07 Holdmyhand

@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.

rom1v avatar Jul 02 '24 08:07 rom1v

@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

Holdmyhand avatar Jul 02 '24 08:07 Holdmyhand

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 avatar Jul 02 '24 09:07 rom1v

Does echo "hello" > output.txt work?

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

rom1v avatar Jul 02 '24 09:07 rom1v

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.

Holdmyhand avatar Jul 02 '24 09:07 Holdmyhand

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.

rom1v avatar Jul 02 '24 09:07 rom1v

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.

Holdmyhand avatar Jul 02 '24 09:07 Holdmyhand

Refs #3386 #3534

rom1v avatar Jul 02 '24 11:07 rom1v

@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 avatar Jul 12 '24 02:07 C1heck0ut

@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

C1heck0ut avatar Jul 12 '24 02:07 C1heck0ut

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. @Holdmyhand 你好,这个问题你解决了吗

huli-ant avatar Jan 13 '25 05:01 huli-ant

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. @Holdmyhand 你好,这个问题你解决了吗

image 经过我一个个ADB版本的测试,我的电脑使用这个1.0.40版本的ADB就可以了,新一点的都不行。可能是新版本ADB输出方式和Window11的某些不知名兼容性问题吧。

Holdmyhand avatar Jan 13 '25 05:01 Holdmyhand

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. @Holdmyhand 你好,这个问题你解决了吗

image 经过我一个个ADB版本的测试,我的电脑使用这个1.0.40版本的ADB就可以了,新一点的都不行。可能是新版本ADB输出方式和Window11的某些不知名兼容性问题吧。

我刚用python试了一下 ,发现也不行,这傻逼windows老是自己偷偷升级,给自己都升炸了 1736747659886

huli-ant avatar Jan 13 '25 05:01 huli-ant

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. @Holdmyhand 你好,这个问题你解决了吗

image 经过我一个个ADB版本的测试,我的电脑使用这个1.0.40版本的ADB就可以了,新一点的都不行。可能是新版本ADB输出方式和Window11的某些不知名兼容性问题吧。

你能给我分享一下你那个能使用的adb不

huli-ant avatar Jan 13 '25 05:01 huli-ant

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. @Holdmyhand 你好,这个问题你解决了吗

image 经过我一个个ADB版本的测试,我的电脑使用这个1.0.40版本的ADB就可以了,新一点的都不行。可能是新版本ADB输出方式和Window11的某些不知名兼容性问题吧。

老铁太牛逼了,我找到这个版本的adb了,一试果然可以,下载链接: https://dl.google.com/android/repository/platform-tools_r28.0.1-windows.zip

huli-ant avatar Jan 13 '25 06:01 huli-ant

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. @Holdmyhand 你好,这个问题你解决了吗

image 经过我一个个ADB版本的测试,我的电脑使用这个1.0.40版本的ADB就可以了,新一点的都不行。可能是新版本ADB输出方式和Window11的某些不知名兼容性问题吧。

你英语好好啊,都可以用英语跟他们交流

huli-ant avatar Jan 13 '25 06:01 huli-ant