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

ERROR: Could not list ADB devices ( new one, not like the others) #3386

Closed
2 tasks done
DamonEvil opened this issue Jul 19, 2022 · 10 comments
Closed
2 tasks done

ERROR: Could not list ADB devices ( new one, not like the others) #3386

DamonEvil opened this issue Jul 19, 2022 · 10 comments

Comments

@DamonEvil
Copy link

DamonEvil commented Jul 19, 2022

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

phone:xiaomi12 pro
os: windows10
scrpcy: 1.24
android version: miui13 (based on android 12)

C:\Users\Administrator\Downloads\scrcpy-win64-v1.24>scrcpy.exe
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
ERROR: Could not list ADB devices
ERROR: Server connection failed

steps before 'scrcpy':
first, I just run adb.exe usb, the result seems right, but scrcpy cannot work,

C:\Users\Administrator\Downloads\scrcpy-win64-v1.24>adb.exe usb
restarting in USB mode

then I searched a lot, run the commands as follows:

C:\Users\Administrator\Downloads\scrcpy-win64-v1.24>adb.exe kill-server

C:\Users\Administrator\Downloads\scrcpy-win64-v1.24>adb.exe start-server
* daemon not running; starting now at tcp:5037
* daemon started successfully

C:\Users\Administrator\Downloads\scrcpy-win64-v1.24>adb.exe devices
List of devices attached
7febd68c        device

the output seems right, but scrcpy still can not work , what should I do to solve this problem? Thanks a lot !

@DamonEvil DamonEvil changed the title ERROR: Could not list ADB devices ERROR: Could not list ADB devices ( new one, not like the others) Jul 19, 2022
@rom1v
Copy link
Collaborator

rom1v commented Jul 19, 2022

What is the result of adb devices -l?

@DamonEvil
Copy link
Author

What is the result of adb devices -l?

C:\Users\Administrator\Downloads\scrcpy-win64-v1.24>adb.exe devices -l
List of devices attached
7febd68c               device product:zeus model:2201122C device:zeus transport_id:6

@rom1v
Copy link
Collaborator

rom1v commented Jul 19, 2022

OK, so it's correct, the content can be parsed correctly.

Maybe the process adb could not be executed from the scrcpy process (some antivirus/firewall or similar).

What is the result of scrcpy -Vdebug?

@DamonEvil
Copy link
Author

DamonEvil commented Jul 19, 2022

Maybe the process adb could not be executed from the scrcpy process (some antivirus/firewall or similar).

before I got the new phone , my last phone-xiaomi11 could be displayed and controlled normally. But I still use the same computer and security software.

What is the result of scrcpy -Vdebug?

same as runing 'scrcpy' alone

C:\Users\Administrator\Downloads\scrcpy-win64-v1.24>scrcpy.exe -Vdebug
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
ERROR: Could not list ADB devices
ERROR: Server connection failed

C:\Users\Administrator\Downloads\scrcpy-win64-v1.24>scrcpy.exe
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
ERROR: Could not list ADB devices
ERROR: Server connection failed

@rom1v
Copy link
Collaborator

rom1v commented Jul 19, 2022

OK, I added some more logs, please replace this binary in your v1.24 release.

  • scrcpy.exe SHA-256: 95d0b9cdbea735e293c1fa0ad7d9394c963dec5a792cdcdce329271eefd97ed7
diff
diff --git a/app/src/adb/adb.c b/app/src/adb/adb.c
index 344f7fcc..c3210d38 100644
--- a/app/src/adb/adb.c
+++ b/app/src/adb/adb.c
@@ -401,6 +401,7 @@ sc_adb_list_devices(struct sc_intr *intr, unsigned flags,
 #define BUFSIZE 65536
     char *buf = malloc(BUFSIZE);
     if (!buf) {
+        LOG_OOM();
         return false;
     }
 
@@ -413,11 +414,13 @@ sc_adb_list_devices(struct sc_intr *intr, unsigned flags,
     }
 
     ssize_t r = sc_pipe_read_all_intr(intr, pid, pout, buf, BUFSIZE - 1);
+    LOGE("read() returned %d", (int) r);
     sc_pipe_close(pout);
 
     bool ok = process_check_success_intr(intr, pid, "adb devices -l", flags);
     if (!ok) {
         free(buf);
+        LOGE("'adb devices -l' failed");
         return false;
     }
 
@@ -440,6 +443,7 @@ sc_adb_list_devices(struct sc_intr *intr, unsigned flags,
 
     // List all devices to the output list directly
     ok = sc_adb_parse_devices(buf, out_vec);
+    LOGD("sc_adb_parse_device() ok? %d", ok);
     free(buf);
     return ok;
 }

@rom1v
Copy link
Collaborator

rom1v commented Jul 19, 2022

Also, what is the result of echo %ADB%?

@DamonEvil
Copy link
Author

DamonEvil commented Jul 19, 2022

well, I just got home. I try it with my computer with windows11, it works perfectly like this:

PS C:\Users\78450\Downloads\scrcpy-win64-v1.24> .\adb.exe usb
* daemon not running; starting now at tcp:5037
* daemon started successfully
error: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
PS C:\Users\78450\Downloads\scrcpy-win64-v1.24> .\adb.exe usb
restarting in USB mode
PS C:\Users\78450\Downloads\scrcpy-win64-v1.24> .\scrcpy.exe
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
ERROR: read() returned 114
C:\Users\78450\Downloads\scrcpy-win64-v1.24\scrcpy-server:... file pushed, 0 skipped. 72.4 MB/s (41159 bytes in 0.001s)
[server] INFO: Device: Xiaomi 2201122C (Android 12)
INFO: Renderer: direct3d
INFO: Initial texture: 1440x3200
libpng warning: iCCP: cHRM chunk does not match sRGB

Before, I tried with my laptop in company actually. I will reply you tomorrow, to see if that new 'scrcpy' works and show you the log of running command and the value of 'echo %ADB%'.

@DamonEvil
Copy link
Author

OK, I added some more logs, please replace this binary in your v1.24 release.

C:\Users\Administrator\Downloads\scrcpy-win64-v1.24>scrcpy.exe
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
ERROR: read() returned -1
ERROR: Could not list ADB devices
ERROR: Server connection failed

C:\Users\Administrator\Downloads\scrcpy-win64-v1.24>scrcpy.exe -Vdebug
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
ERROR: read() returned -1
ERROR: Could not list ADB devices
ERROR: Server connection failed

Also, what is the result of echo %ADB%?

I didn't add it to the system viriable

C:\Users\Administrator\Downloads\scrcpy-win64-v1.24>echo %ADB%
%ADB%

@rom1v
Copy link
Collaborator

rom1v commented Jul 20, 2022

ERROR: read() returned -1

OK, so reading the output of the process failed. Maybe a permission issue related to the OS, if it is only on your company computer :/

@DamonEvil
Copy link
Author

Well, I can not find any problem about the OS, so I give up. Maybe I should buy a new laptop just for work. Thanks a lot.

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

2 participants