Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
113.22k stars 10.8k forks source link

Cannot start scrcpy with python script #5293

Open nicolasvahidzein opened 2 months ago

nicolasvahidzein commented 2 months ago

Hello,

do you know I can start this app via python and not have the win cmd window on windows stay open? There are many print logs that prevent the window from closing.

If i force close the window it also closes the app.

Here is my code and i literally tried 10 different approaches:

subprocess.Popen(['C:/scrcpy-win64-v1.23/scrcpy.exe'], shell=False)

Thanks

rom1v commented 2 months ago

Does this flag help:

subprocess.Popen(['app.exe'], creationflags=subprocess.CREATE_NO_WINDOW)

?

nicolasvahidzein commented 2 months ago

Brilliant, thank you so much. It is exactly what i needed.