Deskbridge › Guides › DeX with scrcpy
Run Samsung DeX on your Mac with scrcpy (free, command line)
Install scrcpy with Homebrew, turn on USB debugging, plug in your Galaxy and run scrcpy --new-display=1920x1080/160. On phones with One UI 8 or later, DeX starts on that virtual display and opens in a Mac window. The rest of this guide covers sharp sizes, portrait mode, shortcuts and the two gotchas — sleep and the lock screen — that confuse almost everyone.
Why this works
scrcpy (by Genymobile) streams an Android display to your computer and sends your keyboard and mouse back. Since version 3.0 it can create a brand-new virtual display with --new-display. Starting with One UI 8, a Galaxy phone launches the full DeX desktop on any new virtual display — so scrcpy gives you the real DeX, not a mirror of your phone screen. (Background: how DeX on a Mac works in 2026.)
1. Install scrcpy and adb
brew install scrcpy
scrcpy --version # must be 3.0 or newer for --new-display
Homebrew's scrcpy pulls in adb (Android's debug bridge) automatically. If adb isn't found, also run brew install --cask android-platform-tools.
2. Turn on USB debugging and authorize your Mac
- Phone: Settings › About phone › Software information, tap Build number seven times.
- Settings › Developer options: turn on USB debugging.
- Plug in, then on the phone tick Always allow from this computer and tap Allow.
- Check it on the Mac:
adb devices # List of devices attached # RFXXXXXXXXX device ← "unauthorized" means tap Allow on the phone
3. Start DeX
scrcpy --new-display=1920x1080/160
A window opens with the DeX desktop. The format is WIDTHxHEIGHT/DPI.
Get the size and DPI right
If DeX looks blurry, enormous or microscopic, the DPI doesn't match the resolution. The rule we use: DPI = 160 × width ÷ 1920. That keeps a comfortable “1080p-sized” desktop at any resolution, just sharper.
| Window | Command |
|---|---|
| 1080p | --new-display=1920x1080/160 |
| 1440p | --new-display=2560x1440/213 |
| 4K / Retina-sharp | --new-display=3840x2160/320 |
| Portrait (phone-style) | --new-display=1080x1920/360 |
Keep width and height multiples of 8 — video encoders dislike odd sizes, and most phones top out around 4K.
Portrait without the cramped tablet layout
Simply swapping width and height at the landscape DPI makes the display about 1,080 dp wide, so apps like Messages switch to their two-pane tablet layout. For a portrait window that behaves like a big phone, size the DPI to the short edge: DPI = 160 × short edge ÷ 480 (about 480 dp wide). For 1080×1920 that's 360; for 2160×3840 it's 720.
4. A better everyday command
scrcpy --new-display=3840x2160/320 \
--window-title=DeX \
--stay-awake \
--video-codec=h265 \
--max-fps=60 \
--shortcut-mod=lsuper,rsuper
--stay-awakekeeps the phone awake while it's plugged in — important, see below.--video-codec=h265looks better at the same bitrate; drop back toh264if scrcpy exits immediately.--shortcut-mod=lsuper,rsupermakes ⌘ the shortcut key. (scrcpy calls the Command keylsuper/rsuper;lcmdis not valid.)
Useful shortcuts with that setting: ⌘H home, ⌘B back (or right-click), ⌘S recent apps, ⌘N notifications, ⌘F fullscreen. Phone audio plays on the Mac by default on Android 11+, and you can drag files onto the window to send them to the phone's Downloads.
5. The two gotchas: sleep and the lock screen
A sleeping phone freezes DeX
When a Galaxy phone sleeps (dozes), the DeX display stops responding. That happens when you press the power button — and, surprisingly, with scrcpy's own --turn-screen-off, which sends Samsung phones into doze. Don't use --turn-screen-off for DeX. If the phone does sleep, wake its own display from the Mac:
adb shell input -d 0 keyevent KEYCODE_WAKEUP
The -d 0 matters: on Android 14+ each display group sleeps separately, so a plain wake key goes to the focused DeX display and the phone screen stays dark.
A locked phone hides the dock
DeX keeps running behind the lock screen, but Samsung shrinks the dock to bare navigation buttons — no apps, no clock — and blocks typing until you unlock. It's a security rule, not a bug. Unlock the phone (fingerprint works without opening a foldable) and everything returns. More on this in keeping the phone screen off without freezing DeX.
6. Wireless (optional)
# Phone: Settings › Developer options › Wireless debugging › Pair device with pairing code
adb pair 192.168.1.20:37155 # IP:port and code from the pairing screen
adb connect 192.168.1.20:41623 # IP:port shown on the main Wireless debugging screen
scrcpy --new-display=1920x1080/160
Over Wi-Fi --stay-awake has no effect (the phone isn't charging from the Mac), so keep the phone from sleeping another way.
Or let Deskbridge do all of this
Deskbridge wraps exactly this setup in a Mac menu-bar app: it bundles scrcpy and adb, opens DeX the moment you plug in, picks the sharp size for your screen, switches to phone-style portrait in one click, and keeps the phone screen black without freezing DeX (Secure Blackout). It also unlocks your phone from your Mac keyboard and adds call banners, notifications and apps in their own windows. $12 once after a 3-day trial — or stick with the commands above; they're free and they work.
FAQ
What scrcpy command starts DeX?
scrcpy --new-display=1920x1080/160 creates a 1920×1080 virtual display at 160 dpi. On Galaxy phones with One UI 8 or later, DeX starts on it automatically. scrcpy 3.0 or newer is required for --new-display.
Why does DeX look blurry or tiny?
The DPI doesn't match the size. Keep a 1080p-sized layout with dpi = 160 × width ÷ 1920 — for example 3840x2160/320 for a sharp 4K window.
Why does DeX freeze when my phone screen turns off?
A sleeping (dozing) Galaxy pauses the DeX virtual display. scrcpy's --turn-screen-off also puts Samsung phones into doze, so avoid it. Keep the phone awake with --stay-awake while plugged in, and don't press the power button.
Why is the DeX dock missing its apps?
Your phone is locked. While the lock screen is showing, Samsung shrinks the DeX dock to bare navigation buttons and blocks typing. Unlock the phone and the full dock returns.
Does scrcpy work over Wi-Fi?
Yes. Pair with adb pair using the code from Settings › Developer options › Wireless debugging, then adb connect to the IP and port it shows, and run the same scrcpy command.
Skip the Terminal
Deskbridge does all of this automatically. Free for 3 days, then $12 once.