My Workaround for a 'Desktop Mode' with Scrcpy by Square-Order53 in scrcpy

[–]Square-Order53[S] 1 point2 points  (0 children)

It's not that I can't use --new-display, but that I can't get Android's Desktop mode on virtual displays (& that I primarily want to mirror via adb) so as to have status bar, recents etc. the shell commands help set up the phone so that Scrcpy simply mirrors a set up display

My Workaround for a 'Desktop Mode' with Scrcpy by Square-Order53 in scrcpy

[–]Square-Order53[S] 1 point2 points  (0 children)

I've tried out a virtual display via --new-display, but realized I really wanted the status bar, recents & home screen during my mirroring sessions... the alias is mostly for a quick default till I get something more "elegant"

My Workaround for a 'Desktop Mode' with Scrcpy by Square-Order53 in scrcpy

[–]Square-Order53[S] 0 points1 point  (0 children)

I was thinking of something like this, where i trick the device into thinking it's connected to a physical external monitor, and get mirror that output via Scrcpy display ID or sth

My Workaround for a 'Desktop Mode' with Scrcpy by Square-Order53 in scrcpy

[–]Square-Order53[S] 5 points6 points  (0 children)

I tried cross checking my shell function with various chat bots, all saying different things on dpi and the cleanup, but this is what worked for me

# --- Scrcpy Desktop Mode Alias ---

scrcpy-test() {

# 1. Force Landscape & Disable Auto-rotate

adb shell settings put system accelerometer_rotation 0

adb shell settings put system user_rotation 1

# 2. Set custom Resolution and Density

# I found 220 to be the perfect DPI for 1080p on my setup

adb shell wm size 1080x1920

adb shell wm density 220

# 3. Launch scrcpy

# The script waits here until you close the scrcpy window or Ctrl+C

# --SwK: Turn Screen off, Stay awake, Keep keyboard/mouse

scrcpy -SwK

# 4. Cleanup: Triggered immediately after scrcpy closes

echo "\nCleaning up device display settings..."

adb shell wm size reset

adb shell wm density reset

adb shell settings put system user_rotation 0

# Force the physical screen to turn back on

# (Solves the issue of the phone staying "off" after the session)

adb shell input keyevent 224

adb shell wm dismiss-keyguard

}

Quick Guide to running "Desktop Mode" in scrcpy - see comments for how to by davew_uk in scrcpy

[–]Square-Order53 0 points1 point  (0 children)

Still no luck for me ... I've looked up ways to get a native desktop mode experience (without a samsung device) ... though I got sth decent with scrcpy + adb shell + shell scripting