rex open
Open the app, or bring it to the front.
- Output
- Both: plain text, or JSON with
--json - Needs the app
- No
rex openCommand line
rex.exe is on your PATH after installing. In a checkout, use REX.bat the same way.
Start with rex agent, or add --json anywhere. Every command then writes exactly one JSON document, never prompts, contains no colour codes, and exits 0 on success and 1 on failure.
{"ok":true,"protocolVersion":2,"command":"status","data":{...}}
{"ok":false,"protocolVersion":2,"command":"action","error":{"type":"InvalidOperationException","message":"..."}}
Ask rex agent capabilities first: it lists every command, action, phone setting and config path this version knows. With more than one phone connected, pass --serial; the command line never guesses between phones.
Commands marked needs the app act on the open window; start it with rex open first. The rest work on their own, over ADB.
rex openOpen the app, or bring it to the front.
--jsonrex openrex statusApp, mirror and phone state.
--jsonrex statusrex devicesPhones visible to ADB.
--jsonrex devicesrex stopStop the mirror. The app stays in the tray.
--jsonrex stoprex quitExit the app completely.
--jsonrex quitrex action <name> [--serial S]Send an action: home, back, sleep, volume, rotation and the rest. rex action list shows the names.
--jsonrex action sleeprex zoom <in|out|reset>Zoom the PC view of the open mirror.
--jsonrex zoom inrex sound [0-100|up|down|mute|unmute|toggle]The phone's sound on this PC: a level, louder, quieter or muted. Without a value, what it is now.
--jsonrex sound 40rex app list [search] [--system] [--serial S]The phone's apps by name. A search finds the phone's own apps too; --system lists them all.
--jsonrex app list spotrex app open <name|package> [--fresh] [--serial S]Open an app by its name or package. --fresh closes it first.
--jsonrex app open Spotifyrex app close|info <package> [--serial S]Close an app completely, or open its info page on the phone.
--jsonrex app close com.spotify.musicrex app favourite <package> on|off [--serial S]Star an app, or take its star away. Favourites have tiles and keys in the app.
--jsonrex app favourite com.spotify.music onrex push <files or folders…> [--to /sdcard/folder/] [--serial S]Copy files or folders into the phone's shared storage.
--jsonrex push photo.jpg --to /sdcard/Pictures/rex install <apk…> [--downgrade] [--grant] [--test] [--no-replace] [--serial S]Install one or more APK files, with optional update flags.
--jsonrex install app.apk --grantrex screen [open <app> [--instead|--beside] [--size follow|phone|720p|1080p|1440p|WxH] [--fresh] | app <app> | close]A second screen for one app, beside the phone or instead of it: open it, switch its app, close it, or see what it is doing.
--jsonrex screen open YouTube --size 1080prex profile list | show <name> | apply <name> | save <name> [--groups Mirror,Sound] [--all] | rename <old> <new> | delete <name> | export <name> <file> | import <file>Profiles: lists of settings to switch to in one go. Save the settings you have now, apply one or a preset, and share them as files. Works with or without the app.
--jsonrex profile apply Gamingrex phones [beside [serial] | stop | switch | make-main]Every connected phone and where it shows: the main phone, the one beside it, and the one in use. With the app running, show one beside, stop it, switch to the other, or swap them.
--jsonrex phones besiderex encoders [--serial S]The phone's video encoders, to choose one with rex config set Mirror.VideoEncoder. Works with or without the app.
--jsonrex encodersrex keys [set <action> <key|none> | reset [action]] [--browse]Every key the window and browse mode answer to. Give any action a key, take one away, or put them back. Works with or without the app.
--jsonrex keys set home Ctrl+Alt+Jrex screenshot [--serial S]Save a picture of the phone screen.
--jsonrex screenshotrex phone list|get [filter]Every phone setting this phone offers, with its value.
--jsonrex phone list brightrex phone set <setting> <value>Change one phone setting (rex phone list shows the ids).
--jsonrex phone set brightness 180rex phone reset <setting>Let Android use its own default for a phone setting again.
--jsonrex phone reset font_scalerex android list|get|set|delete <system|secure|global> [key] [value] [--filter text]Raw Android settings. Keys that could cut off ADB are refused.
--jsonrex android list global --filter animationrex config list|get|set|restore [path] [value]The app's own settings in config.json. set keeps a backup; restore swaps it back.
--jsonrex config set Mirror.MaxFps 90rex autostart <on|off>Start with Windows, or not.
--jsonrex autostart onrex lock-mode <serial> <pattern|other|none>Say what kind of lock screen a phone has.
--jsonrex lock-mode R3CR... patternrex reset-lock [serial|ALL]Forget the lock-screen answers for one phone, or all.
--jsonrex reset-lock ALLrex setupDownload and check the official scrcpy without opening the app.
rex setuprex usb [list|status]ADB interfaces, and USB devices Windows could not read.
--jsonrex usbrex usb repair [--dry-run]Repair both. Asks for administrator approval; --dry-run only says what it would do.
--jsonrex usb repair --dry-runrex usb enable-auto-repair|disable-auto-repair [--dry-run]Fix "USB device not recognised" without asking each time, or stop doing so. Asks once.
--jsonrex usb enable-auto-repairrex usb run-auto-repairStart the installed auto-repair now. Needs no approval.
--jsonrex usb run-auto-repairrex diagnosticsA full report: versions, files, startup, tools, phones and the recent log.
--jsonrex diagnosticsrex agent capabilitiesThe machine-readable contract: commands, actions, settings and paths.
rex agent capabilitiesrex helpThis list.
rex help