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

[Not Working with Android mobile] #2976

Closed
2 tasks
coolcup74 opened this issue Jan 27, 2022 · 21 comments
Closed
2 tasks

[Not Working with Android mobile] #2976

coolcup74 opened this issue Jan 27, 2022 · 21 comments

Comments

@coolcup74
Copy link

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

Environment

  • OS: Windows10
  • scrcpy version: scrcpy v.1.21
  • installation method: download from github directly
  • device model: Android mobile moto g60 (and other android mobiles have the same issue)
  • Android version: 11

Describe the bug
v.1.20 is working fine but,
v.1.21 is not working with the below message.

ERROR: Could not get device serial
ERROR: Server connection failed

@rom1v
Copy link
Collaborator

rom1v commented Jan 27, 2022

Please try the binary provided in #2840.

@coolcup74
Copy link
Author

Unfortunately, still not working with #2840.

@rom1v
Copy link
Collaborator

rom1v commented Jan 27, 2022

You replaced the executable in your v1.21 release?

From a terminal in the scrcpy folder (see FAQ), what is the result of:

adb devices

Then:

scrcpy

@coolcup74
Copy link
Author

Yes. I replcaed it with the executable in v1.21 release.
As I told you, adb connection with my mobile have no problem and no issue with v.1.20.

@rom1v
Copy link
Collaborator

rom1v commented Jan 27, 2022

What is the result of the commands requested in the previous comment?

@coolcup74
Copy link
Author

C:\Users\user>adb devices
List of devices attached
LMV600EAc4e2316a device

C:\Users\user\Downloads\scrcpy-win64-v1.21>scrcpy.exe
scrcpy 1.21 https://github.com/Genymobile/scrcpy
ERROR: Could not get device serial
ERROR: Server connection failed

@rom1v
Copy link
Collaborator

rom1v commented Jan 27, 2022

OK. What are the results of:

adb get-serialno

and

certUtil -hashfile scrcpy.exe SHA256

?

@coolcup74
Copy link
Author

C:\Users\user\Downloads\scrcpy-win64-v1.21>adb get-serialno
LMV600EAc4e2316a

C:\Users\user\Downloads\scrcpy-win64-v1.21>certUtil -hashfile scrcpy.exe SHA256
SHA256의 scrcpy.exe 해시:
8c41744d76ba9003d4a5e5ac7c0e4d42bc136349076b4db099888fdc06f0bb5a
CertUtil: -hashfile 명령이 성공적으로 완료되었습니다.

C:\Users\user\Downloads\scrcpy-win64-v1.21>scrcpy.exe
scrcpy 1.21 https://github.com/Genymobile/scrcpy
ERROR: Could not get device serial
ERROR: Server connection failed

C:\Users\user\Downloads\scrcpy-win64-v1.21>

@rom1v
Copy link
Collaborator

rom1v commented Jan 27, 2022

Thank you. That's bad, because I have no idea why :/

For all users until now (even on Windows 10), this problem in v1.21 is fixed by #2840, but it's definitely not the case for you.

What if you copy scrcpy.exe and scrcpy-server (not the other files) from v1.20 into your v1.21 release? Does it still fail?

Are you comfortable with building the app manually (BUILD)?

@rom1v
Copy link
Collaborator

rom1v commented Jan 27, 2022

Ah, one more test:

adb get-serialno
" then immediately after
echo %errorlevel%

@coolcup74
Copy link
Author

v1.21 with copy of scrcpy.exe and scrcpy-server in v1.20 --> No issue!

C:\Users\user\Downloads\scrcpy-win64-v1.21>adb get-serialno
LMV600EAc4e2316a

C:\Users\user\Downloads\scrcpy-win64-v1.21>echo %errorlevel%
0

Refering to build guide, I will try to build manually.

Very Appreciated for your great support.
Hope sort out this after building and debugging. ^^

@rom1v
Copy link
Collaborator

rom1v commented Jan 27, 2022

Could you please retry with this version (it's basically #2840 with more logs) and post the output, please:

  • scrcpy.exe sha256:3fc001ebdaee699ad0acf73693dda7482f41a8daae69533b2012a90d03047374

Also, could you test with the current development branch (+ some other pending work):

  • scrcpy.exe sha256:172007406c89f4fb2a193b69e0ec61fbdf35301247bfebbe8cdc1276c148dee3
  • scrcpy-server sha256:c90ac7684be81ced7b5b9d0be770952894585d2eaabf836ad60ef51f28507781

(you need to replace both files, and you'll need to restore scrcpy-server from v1.21 after that).

@coolcup74
Copy link
Author

Case 1.
C:\Users\user\Downloads\scrcpy-win64-v1.21>scrcpy.exe
scrcpy 1.21 https://github.com/Genymobile/scrcpy
INFO: === execution success
INFO: === get-serialno: read -1 bytes
INFO: === process check #1
INFO: === process check #2
INFO: === process check #3
INFO: === process ok? 1
ERROR: Could not get device serial
ERROR: Server connection failed

Case 2.
error popup with 'avutil-57.dll not exists'

@rom1v
Copy link
Collaborator

rom1v commented Jan 28, 2022

Case 1.

Could you try with even more logs, please:

  • scrcpy.exe sha256:b04a645dacbc748f33fcdb6640a1f042f2d10ed436c63e5b633081ae59e7b232

Case 2.

error popup with 'avutil-57.dll not exists'

Here is a full archive (like a release):

@coolcup74
Copy link
Author

Case 1.
PS C:\Users\user\Downloads\scrcpy-win64-v1.21> .\scrcpy.exe
scrcpy 1.21 https://github.com/Genymobile/scrcpy
INFO: === execution success
ReadFile: [109] 파이프가 끝났습니다.
INFO: === get-serialno: read -1 bytes
INFO: === process check #1
INFO: === process check #2
INFO: === process check #3
INFO: === process ok? 1
ERROR: Could not get device serial
ERROR: Server connection failed

Case 2.
PS C:\Users\user\Downloads\scrcpy-win64-2976> .\scrcpy.exe
scrcpy 1.21 https://github.com/Genymobile/scrcpy
ERROR: Could not get device serial
ERROR: Server connection failed

@rom1v
Copy link
Collaborator

rom1v commented Jan 28, 2022

Thank you for your tests.

I really don't know why reading the output of adb get-serialno from scrcpy fails, while if you execute it from cmd you get an output.

Just to confirm the stdout and stderr content:

adb get-serialno >stdout.txt 2>stderr.txt
more stdout.txt
more stderr.txt

I could not reproduce, so it's difficult to investigate. :/

FYI, I will release a new version (v1.22) soon, I wanted to fix this issue beforehand, but I have no clue for now 😞
If I can't, I'll release v1.22 and attempt to fix it later.

@coolcup74
Copy link
Author

Myself also feel very sorry for not helping you fixing... but,
I think that the below could be the clue for fixing this issue.

  1. runtime output is fine with adb get-serialno only.
  2. txt file have nothing even runtime command succeed.

Hope it could be helpful for v1.22.

Thank you.

@rom1v
Copy link
Collaborator

rom1v commented Jan 28, 2022

txt file have nothing even runtime command succeed.

You mean that if you execute:

adb get-serialno >stdout.txt 2>stderr.txt

Then both stdout.txt and stderr.txt are empty?

It that's the case, then the problem is not from scrpcy (since getting empty files for this command is unexpected, and scrcpy is not involved).

Something is messing up with process redirection on your system (or adb.exe, but since it comes from the scrcpy release, it's the official one and the same as I use in my tests on Windows).

Do you have some antivirus/firewall?

If you execute:

echo hello > stdout.txt
more stdout.txt

Does the file contain hello?

@coolcup74
Copy link
Author

Yes. Even logcat can be captured....
But,,, get-serialno can not be captured...
Myself also can not understand why this happen..

@coolcup74
Copy link
Author

It was by crash of fire-wall program.
It is fixed.
Thank you for great support!!!

@fun-zonez
Copy link

In my case USB debugging settings in my android device is automatically dis-enabled in 10 mins and I just enabled that, now everything working fine.

@rom1v rom1v closed this as completed Apr 3, 2022
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

3 participants