Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
106.05k stars 10.27k forks source link

Can not open the scrcpy application #3182

Open EceAydin opened 2 years ago

EceAydin commented 2 years ago

Environment

Describe the bug I cannot run the scrcpy application for both versions 1.19 and 1.23. When I double click the application, nothing happens.

Please paste terminal output in a code block.
ERROR: CreateProcessW() error 5
ERROR: Failed to execute: [C:\adb_1.0.39], [start-server]
ERROR: Could not execute "adb start-server"
ERROR: Could not start adb daemon
ERROR: Server connection failed
rom1v commented 2 years ago

ERROR: Failed to execute: [C:\adb_1.0.39]

You set an incorrect ADB environment variable.

The best is to just remove this ADB variable, so that scrcpy uses the adb.exe packaged with the release.

If you absolutely need to use another adb, set ADB to the path of the adb.exe executable, not its parent directory (in your case, probably C:\adb_1.0.39\adb.exe).

s02mike commented 2 years ago

Hey @EceAydin,

I had this issue as well. I think because my phone had an update last night (4/12/2022), and the usb debugging RSA key needed to be refreshed. I THINK... lol. I'm not really educated with all the programming stuff so I just throw everything I can think of at the problem till I figure it out. This is what I did, YMMV.

On PC

  1. Downloaded Scrcpy 1.23
  2. Downloaded the Android SDK Platform Tools ZIP file for Windows @ https://dl.google.com/android/repository/platform-tools-latest-windows.zip
  3. Extracted platform-tools_r33.0.1-windows.zip 3.1 Copied adb.exe from folder platform-tools_r33.0.1-windows\platform-tools\adb.exe 3.2 Deleted adb.exe in folder scrcpy-win64-v1.23\adb.exe and replaced it with the copied updated version On Android
  4. Connected phone to PC with USB cable
  5. Turned off USB debugging in Developer Options
  6. Pressed Revoked USB debugging authorizations that should be under the USB debugging on/off
  7. Turned on USB debugging
  8. Approved RSA key On PC
  9. Win+r "cmd"
  10. In prompt navigate to scrcpy-win64-v1.23\
  11. Arrived to folder scrcpy-win64-v1.23\ and typed "adb.exe devices" without the "quotes"
  12. It should say List of devices attached some serial number and then device.
  13. If it says some serial number and unauthorized or something of the nature (I already forgot what it said) re-release your RSA key by following steps 5 - 8

I referenced https://www.xda-developers.com/install-adb-windows-macos-linux/ and Followed "How to setup ADB on Microsoft Windows"

Much love to all and good luck friends Mike

ahmedbereir commented 7 months ago

i have these errors : ERROR: Failed to execute: ["C:\scrcpy-win64-v2.0\scrcpy-win64-v2.0"], [start-server] ERROR: Could not execute "adb start-server" ERROR: Could not start adb daemon ERROR: Server connection failed

rom1v commented 7 months ago

ERROR: Failed to execute: ["C:\scrcpy-win64-v2.0\scrcpy-win64-v2.0"], [start-server]

Because you have set your ADB environment variable to a wrong value (it must point to the adb executable if it is set). You should just unset this environment variable, scrcpy uses the correct one by default.