scrcpy icon indicating copy to clipboard operation
scrcpy copied to clipboard

Force desktop mode Android 10

Open KanielOut1s opened this issue 5 years ago • 43 comments

Hello, suggestion to make force desktop mode work on scrcpy? Would be a great feature.

KanielOut1s avatar May 20 '20 17:05 KanielOut1s

You mean "DeX" or something like that? https://github.com/Genymobile/scrcpy/issues/397#issuecomment-628191039

rom1v avatar May 20 '20 18:05 rom1v

Dex is only for samsung. I'm using oneplus where dex is not available. But theres a feature of Android 10 called "Forced desktop mode" from developers option. Is it possible to make it work in scrcpy? I tried the solution from dex request but unfortunately it doesn't work.

KanielOut1s avatar May 20 '20 18:05 KanielOut1s

Oh, indeed, I have this option on my OnePlus 7 Pro. I don't know how it works though (what happens once it's enabled?).

rom1v avatar May 20 '20 20:05 rom1v

Using scrcpy, it only mirrors the phone screen.

KanielOut1s avatar May 21 '20 01:05 KanielOut1s

images

It should look like this. Left side u can add app shortcut to desktop. Right side opens the app installed in your phone.

KanielOut1s avatar May 21 '20 01:05 KanielOut1s

Using scrcpy, it only mirrors the phone screen.

That's expected before Android 10: https://github.com/Genymobile/scrcpy/blob/master/README.md#display

But it should work on Android 10 :/

Any message in the console?

rom1v avatar May 21 '20 06:05 rom1v

The secondary display that would show desktop mode isn't online, so scrcpy can't connect to it

[server] ERROR: Exception on thread Thread[main,5,main]
com.genymobile.scrcpy.InvalidDisplayIdException: There is no display having id 1
        at com.genymobile.scrcpy.Device.<init>(Device.java:46)
        at com.genymobile.scrcpy.Server.scrcpy(Server.java:20)
        at com.genymobile.scrcpy.Server.main(Server.java:177)
        at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:362)
[server] ERROR: Try to use one of the available display ids:
[server] ERROR:     scrcpy --display 0

ColinHeathman avatar May 25 '20 18:05 ColinHeathman

So, u mean there is no work around for this? Anyway, thanks for your help.

KanielOut1s avatar May 27 '20 23:05 KanielOut1s

I kind of found a workaround. I'm using a pixel3 xl.

Using this app called SecondScreen you can force the screen of the device to change - https://play.google.com/store/apps/details?id=com.farmerbb.secondscreen.free&hl=en_US

A couple of notes on this:

  1. By default it forces the screen orientation to landscape. This might be fine but it does not seem to go away until reboot. I'm using 'Use System Settings' and letting scrcpy control this.
  2. Launch scrcpy after you've changed the screen setting of the app for scrcpy to show the screen in the right size.
  3. I'm still playing with the sizing but you can have a much bigger screen with this desktop mode or not. If you want desktop mode you just need to load the launcher that supports it. Taskbar for example and I'm sure there are others.

vmorghulis5887 avatar May 31 '20 20:05 vmorghulis5887

I am using scrcpy with 4 monitors other than my phone's screen. I do that by simply simulating virtually secondary displays using the global setting overlay_display_devices which used in developer settings "Simulate Secondary Displays". I can simulate up to 4 3840x2160 displays by this command adb shell settings put global overlay_display_devices 3840x2160/480\;3840x2160/480\;3840x2160/480\;3840x2160/480

and then run this command to find each display's id so I can mirror it by --display ID (every time I change the overlay_display_devices value it gives the displays new ids) adb shell dumpsys display | findstr /r /c:"Display [0-9][0-9]*"

my problem is that with the simulated displays my phone screen gets crammed with semi-transparent displays. I wish if scrcpy can trick the phone that it is connected to some sort of external display or at least simulate non-visible screens that don't pop up on the main (phone) screen.

I enabled force desktop mode with the new taskbar 6.0 to give the external displays a taskbar and SecondaryDisplays to quickly test dpi and hide nav bar or android 10 gestures bill.

Screenshot (2)

i39MT avatar Jun 07 '20 20:06 i39MT

@i39MT Thank you for the trick.

However, on my OnePlus 7 Pro, if a add a simulated secondary display, mirroring it displays a blank screen.

rom1v avatar Jun 07 '20 20:06 rom1v

@i39MT Thank you for the trick.

However, on my OnePlus 7 Pro, if a add a simulated secondary display, mirroring it displays a blank screen.

Have you enabled "Enable freeform windows" and "Force activities to be resizable" in dev settings?

i39MT avatar Jun 07 '20 20:06 i39MT

@i39MT Thank you for the trick. However, on my OnePlus 7 Pro, if a add a simulated secondary display, mirroring it displays a blank screen.

Have you enabled "Enable freeform windows" and "Force activities to be resizable" in dev settings?

I have the same problem, both enables ("Enable freeform windows" and "Force activities to be resizable") it displays a blank screen only.. (Redmi note 7 - MIUI 12 - Android 10 [EU rom]) EDIT: When the device is locked i can see a desktop lock screen, when unlocked goes black again

scrcpy_fpsxpYXBsA scrcpy_kiJyJCdgWj

lerg96 avatar Jun 14 '20 15:06 lerg96

@i39MT Thank you for the trick. However, on my OnePlus 7 Pro, if a add a simulated secondary display, mirroring it displays a blank screen.

Have you enabled "Enable freeform windows" and "Force activities to be resizable" in dev settings?

I have the same problem, both enables ("Enable freeform windows" and "Force activities to be resizable") it displays a blank screen only.. (Redmi note 7 - MIUI 12 - Android 10 [EU rom]) EDIT: When the device is locked i can see a desktop lock screen, when unlocked goes black again

scrcpy_fpsxpYXBsA scrcpy_kiJyJCdgWj

I got the same lockscreen when I lock my phone. The black screen might be because the default launcher, change it to something like nova launcher or taskbar v6.0.

i39MT avatar Jun 14 '20 16:06 i39MT

@i39MT Thank you for the trick. However, on my OnePlus 7 Pro, if a add a simulated secondary display, mirroring it displays a blank screen.

Have you enabled "Enable freeform windows" and "Force activities to be resizable" in dev settings?

I have the same problem, both enables ("Enable freeform windows" and "Force activities to be resizable") it displays a blank screen only.. (Redmi note 7 - MIUI 12 - Android 10 [EU rom]) EDIT: When the device is locked i can see a desktop lock screen, when unlocked goes black again scrcpy_fpsxpYXBsA scrcpy_kiJyJCdgWj

I got the same lockscreen when I lock my phone. The black screen might be because the default launcher, change it to something like nova launcher or taskbar v6.0.

right now i am using nova launcher, will try with taskbar 6.0

lerg96 avatar Jun 14 '20 16:06 lerg96

Where in the Android 10 source code do I configure default open to force desktop mode?

leokwu avatar Aug 11 '20 08:08 leokwu

Hi, How do you remove app icon, added on desktop from "Add app shortcut" ?? It seems to there is no way to remove any added shortcut...

AfroUSApl avatar Oct 02 '20 22:10 AfroUSApl

Im not sure actually im using taskbar as my home app so it can assign a specific launcher to ur phones screen while managing the additional display with a much more optimized interface.

i39MT avatar Oct 02 '20 22:10 i39MT

Im not sure actually im using taskbar as my home app so it can assign a specific launcher to ur phones screen while managing the additional display with a much more optimized inter

I am using scrcpy with 4 monitors other than my phone's screen. I do that by simply simulating virtually secondary displays using the global setting overlay_display_devices which used in developer settings "Simulate Secondary Displays". I can simulate up to 4 3840x2160 displays by this command adb shell settings put global overlay_display_devices 3840x2160/480\;3840x2160/480\;3840x2160/480\;3840x2160/480

and then run this command to find each display's id so I can mirror it by --display ID (every time I change the overlay_display_devices value it gives the displays new ids) adb shell dumpsys display | findstr /r /c:"Display [0-9][0-9]*"

my problem is that with the simulated displays my phone screen gets crammed with semi-transparent displays. I wish if scrcpy can trick the phone that it is connected to some sort of external display or at least simulate non-visible screens that don't pop up on the main (phone) screen.

I enabled force desktop mode with the new taskbar 6.0 to give the external displays a taskbar and SecondaryDisplays to quickly test dpi and hide nav bar or android 10 gestures bill.

Screenshot (2)

would you help me sir, i have compeleted all your steps when i reached to display's id i types the display id's like --Display 0 and press enter the command doesn't recognised. sir please help i want use my pc as secondary diplay as android dex in android 10

Mksuthar-de avatar Dec 01 '20 11:12 Mksuthar-de

what do you got when you type:

adb shell dumpsys display | findstr /r /c:"Display [0-9][0-9]*"

On Tue, Dec 1, 2020, 14:27 Mksuthar-de [email protected] wrote:

Im not sure actually im using taskbar as my home app so it can assign a specific launcher to ur phones screen while managing the additional display with a much more optimized inter

I am using scrcpy with 4 monitors other than my phone's screen. I do that by simply simulating virtually secondary displays using the global setting overlay_display_devices which used in developer settings "Simulate Secondary Displays". I can simulate up to 4 3840x2160 displays by this command adb shell settings put global overlay_display_devices 3840x2160/480;3840x2160/480;3840x2160/480;3840x2160/480

and then run this command to find each display's id so I can mirror it by --display ID (every time I change the overlay_display_devices value it gives the displays new ids) adb shell dumpsys display | findstr /r /c:"Display [0-9][0-9]*"

my problem is that with the simulated displays my phone screen gets crammed with semi-transparent displays. I wish if scrcpy can trick the phone that it is connected to some sort of external display or at least simulate non-visible screens that don't pop up on the main (phone) screen.

I enabled force desktop mode with the new taskbar 6.0 to give the external displays a taskbar and SecondaryDisplays to quickly test dpi and hide nav bar or android 10 gestures bill.

[image: Screenshot (2)] https://user-images.githubusercontent.com/66570391/83979084-6a889f00-a914-11ea-83ec-13ad0b2b96b6.png

would you help me sir, i have compeleted all your steps when i reached to display's id i types the display id's like --Display 0 and press enter the command doesn't recognised. sir please help i want use my pc as secondary diplay as android dex in android 10

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Genymobile/scrcpy/issues/1413#issuecomment-736460051, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP34RF6JUE4UNKKUHEI3RB3SSTHJNANCNFSM4NGF2DYA .

i39MT avatar Dec 01 '20 11:12 i39MT

what do you got when you type: adb shell dumpsys display | findstr /r /c:"Display [0-9][0-9]" On Tue, Dec 1, 2020, 14:27 Mksuthar-de @.*> wrote: Im not sure actually im using taskbar as my home app so it can assign a specific launcher to ur phones screen while managing the additional display with a much more optimized inter I am using scrcpy with 4 monitors other than my phone's screen. I do that by simply simulating virtually secondary displays using the global setting overlay_display_devices which used in developer settings "Simulate Secondary Displays". I can simulate up to 4 3840x2160 displays by this command adb shell settings put global overlay_display_devices 3840x2160/480;3840x2160/480;3840x2160/480;3840x2160/480 and then run this command to find each display's id so I can mirror it by --display ID (every time I change the overlay_display_devices value it gives the displays new ids) adb shell dumpsys display | findstr /r /c:"Display [0-9][0-9]" my problem is that with the simulated displays my phone screen gets crammed with semi-transparent displays. I wish if scrcpy can trick the phone that it is connected to some sort of external display or at least simulate non-visible screens that don't pop up on the main (phone) screen. I enabled force desktop mode with the new taskbar 6.0 to give the external displays a taskbar and SecondaryDisplays to quickly test dpi and hide nav bar or android 10 gestures bill. [image: Screenshot (2)] https://user-images.githubusercontent.com/66570391/83979084-6a889f00-a914-11ea-83ec-13ad0b2b96b6.png would you help me sir, i have compeleted all your steps when i reached to display's id i types the display id's like --Display 0 and press enter the command doesn't recognised. sir please help i want use my pc as secondary diplay as android dex in android 10 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#1413 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP34RF6JUE4UNKKUHEI3RB3SSTHJNANCNFSM4NGF2DYA .

i got Display 0 : Display 11:

Mksuthar-de avatar Dec 01 '20 11:12 Mksuthar-de

Then:

scrcpy --display 0
scrcpy --display 11

rom1v avatar Dec 01 '20 11:12 rom1v

Then:

scrcpy --display 0
scrcpy --display 11

i typed this says scrcpy : unknown option --display

Mksuthar-de avatar Dec 01 '20 11:12 Mksuthar-de

what do you got when you type: adb shell dumpsys display | findstr /r /c:"Display [0-9][0-9]" On Tue, Dec 1, 2020, 14:27 Mksuthar-de @.*> wrote: Im not sure actually im using taskbar as my home app so it can assign a specific launcher to ur phones screen while managing the additional display with a much more optimized inter I am using scrcpy with 4 monitors other than my phone's screen. I do that by simply simulating virtually secondary displays using the global setting overlay_display_devices which used in developer settings "Simulate Secondary Displays". I can simulate up to 4 3840x2160 displays by this command adb shell settings put global overlay_display_devices 3840x2160/480;3840x2160/480;3840x2160/480;3840x2160/480 and then run this command to find each display's id so I can mirror it by --display ID (every time I change the overlay_display_devices value it gives the displays new ids) adb shell dumpsys display | findstr /r /c:"Display [0-9][0-9]" my problem is that with the simulated displays my phone screen gets crammed with semi-transparent displays. I wish if scrcpy can trick the phone that it is connected to some sort of external display or at least simulate non-visible screens that don't pop up on the main (phone) screen. I enabled force desktop mode with the new taskbar 6.0 to give the external displays a taskbar and SecondaryDisplays to quickly test dpi and hide nav bar or android 10 gestures bill. [image: Screenshot (2)] https://user-images.githubusercontent.com/66570391/83979084-6a889f00-a914-11ea-83ec-13ad0b2b96b6.png would you help me sir, i have compeleted all your steps when i reached to display's id i types the display id's like --Display 0 and press enter the command doesn't recognised. sir please help i want use my pc as secondary diplay as android dex in android 10 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#1413 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP34RF6JUE4UNKKUHEI3RB3SSTHJNANCNFSM4NGF2DYA .

i got Display 0 : Display 11:

sir do you have youtube channel ? i will be very helpful you give me a tutorial of each step

Mksuthar-de avatar Dec 01 '20 11:12 Mksuthar-de

what do you got when you type: adb shell dumpsys display | findstr /r /c:"Display [0-9][0-9]" On Tue, Dec 1, 2020, 14:27 Mksuthar-de @.*> wrote: Im not sure actually im using taskbar as my home app so it can assign a specific launcher to ur phones screen while managing the additional display with a much more optimized inter I am using scrcpy with 4 monitors other than my phone's screen. I do that by simply simulating virtually secondary displays using the global setting overlay_display_devices which used in developer settings "Simulate Secondary Displays". I can simulate up to 4 3840x2160 displays by this command adb shell settings put global overlay_display_devices 3840x2160/480;3840x2160/480;3840x2160/480;3840x2160/480 and then run this command to find each display's id so I can mirror it by --display ID (every time I change the overlay_display_devices value it gives the displays new ids) adb shell dumpsys display | findstr /r /c:"Display [0-9][0-9]" my problem is that with the simulated displays my phone screen gets crammed with semi-transparent displays. I wish if scrcpy can trick the phone that it is connected to some sort of external display or at least simulate non-visible screens that don't pop up on the main (phone) screen. I enabled force desktop mode with the new taskbar 6.0 to give the external displays a taskbar and SecondaryDisplays to quickly test dpi and hide nav bar or android 10 gestures bill. [image: Screenshot (2)] https://user-images.githubusercontent.com/66570391/83979084-6a889f00-a914-11ea-83ec-13ad0b2b96b6.png would you help me sir, i have compeleted all your steps when i reached to display's id i types the display id's like --Display 0 and press enter the command doesn't recognised. sir please help i want use my pc as secondary diplay as android dex in android 10 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#1413 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP34RF6JUE4UNKKUHEI3RB3SSTHJNANCNFSM4NGF2DYA .

sir do you have youtube channel ? i will be very helpful you give me a tutorial of each step

Mksuthar-de avatar Dec 01 '20 11:12 Mksuthar-de

scrcpy : unknown option --display

Then use the latest version.

rom1v avatar Dec 01 '20 12:12 rom1v

scrcpy : unknown option --display

Then use the latest version.

i am using latest version btw would you suggest me any tutorial video. plzzz

Mksuthar-de avatar Dec 01 '20 12:12 Mksuthar-de

What is the result of scrcpy --version?

rom1v avatar Dec 01 '20 12:12 rom1v

dependencies:

  • SDL 2.0.12
  • libavcodec 58.91.100
  • libavformat 58.45.100
  • libavutil 56.51.100

Mksuthar-de avatar Dec 01 '20 12:12 Mksuthar-de

You missed the first line, where the scrcpy version is printed (above "dependencies") :smile:

rom1v avatar Dec 01 '20 12:12 rom1v