Skip to content

tiagomta/android-dock

Repository files navigation

Android Dock

A small Electron tray app that starts scrcpy automatically when an Android device is connected.

It’s designed for a few simple workflows:

  • Display mode: creates a new virtual display via scrcpy (--new-display=...) and launches scrcpy there
  • Mirror mode: standard scrcpy mirroring
  • Audio mode: audio-only (no window)
  • Camera mode: uses the phone camera as the video source
  • Capture mode: camera + microphone capture without a window (currently in development)

The tray menu lets you toggle:

  • Status (active/inactive)
  • Mode (display / mirror / audio / camera)
  • Audio (both / host / device) (only shown for display, mirror, audio)
  • Fullscreen (on/off) (only shown for display, mirror)
  • Control (on/off) (only shown for display, mirror)
  • Camera (front / back) (only shown for camera)

These options are persisted per-user on your PC.

Supported platforms

  • Windows
  • Linux

macOS is currently not supported.

How it works

  • Uses adb wait-for-device to block until a device is available
  • Spawns scrcpy with arguments based on the tray options
  • Restarts scrcpy automatically if it exits and Status is set to Active

Configuration (persistent options)

Options are stored in a JSON file under Electron’s per-user data directory:

  • File name: config.json
  • Location: app.getPath("userData")

Typical locations:

  • Windows: %APPDATA%\Android Dock\config.json
  • Linux: ~/.config/Android Dock/config.json

Current config schema:

{
  "active": true,
  "mode": "display",
  "fullscreen": true,
  "control": true,
  "audio": "both",
  "camera": "front"
}

Notes:

  • mode: display | mirror | audio | camera | capture (capture is supported but not selectable from the tray menu)
  • audio: both | host | device
    • device disables scrcpy audio capture (use the phone speakers)
    • host plays the device audio on the host
    • both plays on the host and duplicates on the device (if supported)
  • camera: front | back (used by camera / capture)

Development

Requirements:

  • Node.js + npm

Commands:

  • npm install
  • npm start

Building

  • npm run build

Windows note (symlinks)

If the build fails with messages about creating symbolic links, enable Windows Developer Mode or run the build from an elevated terminal. Some electron-builder tooling extracts archives that contain symlinks.

Credits

This project uses scrcpy (Screen Copy) by Genymobile.

scrcpy is an independent project with its own license and authors. See THIRD_PARTY_NOTICES.md for details.

License

This project is licensed under the ISC License — see LICENSE.

About

An Electron app to dock and mirror Android devices using scrcpy.

Resources

License

Stars

Watchers

Forks

Contributors