Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
109.94k stars 10.56k forks source link

Scrcpy put android phone on Desktop mode? #2114

Open carlosinters opened 3 years ago

carlosinters commented 3 years ago

Sorry if this is not the place to post my comment but I´m new on the platform, I have been using srcpy to stream my Huawei p30 pro desktop mode to a windows 10 computer its been great with no lag whatsoever. The problem is that in order to activate the desktop mode I have to use the build in wireless display of windows 10 which randomly closes. So I would like to know there is any change of making srcpy activate the desktop mode of the android phone directly, I know some c++ so if someone points me to the right direction I could help to do it, thanks.

kimehta commented 3 years ago

not familiar with huawei desktop mode but modify "scrcpy-console.bat" to achieve something similar. for example, "adb shell am start -n com.google.android.calculator/com.android.calculator2.Calculator" launches the calculator.

you can download rk.android.app.shortcutmaker to see if the huawei launcher has any such trigger for desktop mode. if not, download a third party app like sentio desktop. a different app: https://www.xda-developers.com/make-android-10-desktop-mode-useful/

gaussandhisgun commented 3 years ago

desktop mode is that one which launches on second screen? here is a guess: adb shell settings put global overlay_display_devices 480x800/200 will create a virtual display with size 480x800 and density 200, which can be used as second display. adb shell settings put global overlay_display_devices none will remove that display. you can also enable the option to always run desktop mode on external displays somewhere at the bottom of Developer settings. this is what i achieved with this on my Linux: Снимок экрана_2021-02-16_19-55-20 on the left is actual phone screen with Lawnchair on it, on the right is Taskbar with "external display" feature. you can always specify the display with scrcpy --display NUMBER_OF_DISPLAY, and if you used wrong display number, it'll give you list of right ones, like this: Снимок экрана_2021-02-16_19-58-20 Снимок экрана_2021-02-16_19-59-05

carlosinters commented 3 years ago

Thank you for your quick reply I tested both options and the Sentio Desktop does not open multiple windows on my p30 pro, not even following the tutorial to enable it with adb, and using the second display commented does not launch the phone on desktop mode and this phone does not have that option on development tools. To clarify what I was refering to as the desktop mode is the new interface that some phones like huawei, samsung open when connected to an external display.

What I do to get it running with Srcpy is open this windows remote connect APP (which have a terrible latency) then I have the --display X with desktop mod running available for scrcpy and use it correctly, this is a screenshot of the process

First I open this windows App: app

Then I connect my phone to this screen using the "remote display" on android: remoteWindowsDisplay

But this app have a terrible latency making it unsuable, so I use srcpy to connect to a new available --display X which shows me the desktop display and I can use it without any lag: image

But I have two issues with this method, the majojr one is that the windows App crashes randomly so I have to make everything again, and the second one is having two remote screens when needing only one.

My question is does anybody know how or where may I read something about enabling this "desktop mode" or making the phone thing it is connected to a second screen when using Scrcpy?, thanks

yume-chan commented 3 years ago

adb shell settings put global overlay_display_devices 480x800/200 will create a virtual display with size 480x800 and density 200, which can be used as second display.

I think it's same as the "Simulate secondary display" option in Developer settings.


Sadly it doesn't work on my Samsung S9 running Android 10. Maybe it's too old. Scrcpy can connect to the secondary display but it's always black.

iHad169 commented 3 years ago

My Phone is Samsung A40s. I use Taskbar app after can show DesktopMode. I follow this video setup Taskbar. After:

adb shell settings put global overlay_display_devices 2560x1080/120
scrcpy --display 3  # My this time <NUMBER_OF_DISPLAY> is 3

2021-06-11 07-29-01 的螢幕擷圖

nikp123 commented 2 years ago

Neat, I rediscovered this it seems. The script I wrote that sets this up: https://github.com/nikp123/scrcpy-desktop