DroidBridge

Your Android device, live inside VS Code.

Tap, swipe and type on a real phone or tablet from the sidebar. Then let your AI agent do the same.

DroidBridge sidebar showing a live tablet home screen

Open Settings, find the Battery page and tell me the battery level.

  1. launch_app com.android.settingsLaunched com.android.settings
  2. tap_element text: "Battery"Tapped TextView "Battery"
  3. ui_tree filter: "%"TextView "100 %" id=usage_summary
  4. press_key homePressed home

The battery is at 100 %, and the device is back on the home screen.

Get started

DroidBridge works with USB devices, emulators and phones on your Wi-Fi. You only need ADB, and DroidBridge finds or downloads it for you.

  1. Install the extension from the VS Code Marketplace or Open VSX, or run:
    code --install-extension lusansapkota.droidbridge
  2. Turn on developer options on the device: Settings > About phone, then tap Build number seven times.
  3. Connect the device. Plug it in over USB and accept the debugging prompt, or start an emulator. The sidebar shows Device ready as soon as ADB sees it.
  4. For Wi-Fi, open Developer options > Wireless debugging. Pair once with the code shown there using Wireless Pairing in the sidebar, then enter the IP and port under Connect.
  5. Open the DroidBridge view in the activity bar and click Start Mirror.

Screen mirror

The device screen streams into the sidebar and stays interactive. It keeps the device's shape at any sidebar width and follows rotation, so phones and landscape tablets both fit.

To do thisOn the mirror
TapClick
Swipe or dragClick and drag
ScrollMouse wheel or trackpad
TypeClick the mirror, then type. Enter, Backspace and arrow keys work.
BackRight click or Escape, or the back button in the toolbar
Home, recent apps, rotateToolbar buttons above the mirror

More room

Use Open in editor tab to move the mirror into a resizable editor tab. Drag that tab out to give the device its own window, and use Move back to sidebar to dock it again.

Mirror in an editor tab showing a tablet with the keyboard open

Prefer the classic scrcpy window? Use Open in native scrcpy window. It needs scrcpy installed; the embedded mirror does not.

AI agents (MCP)

DroidBridge includes an MCP server, so AI agents can look at the screen, read its elements, tap, type, read logs and install builds. Keep the mirror open and watch every step.

Try prompts like these:

  • Install the debug APK from app/build/outputs, log in with the test account and tell me if the dashboard loads.
  • Open the settings screen and check logcat for the crash. Explain the cause.
  • Rotate the tablet and check whether the checkout layout still fits.

GitHub Copilot in VS Code

Nothing to set up. Open Copilot Chat in Agent mode, open the tools picker and enable DroidBridge Android.

Claude Code

Run DroidBridge: Set Up AI Agent Access (MCP) from the command palette, choose Claude Code, and paste the copied command into a terminal. It looks like this:

claude mcp add droidbridge -e DROIDBRIDGE_ADB="/path/to/adb" -- node "/path/to/globalStorage/lusansapkota.droidbridge/mcp-server.js"

Cursor, Claude Desktop, Windsurf and others

Run the same command and choose the JSON option, then add it to the client's MCP configuration:

{
  "mcpServers": {
    "droidbridge": {
      "command": "node",
      "args": ["/path/to/globalStorage/lusansapkota.droidbridge/mcp-server.js"],
      "env": { "DROIDBRIDGE_ADB": "/path/to/adb" }
    }
  }
}

External clients need Node.js. The copied path stays the same when DroidBridge updates.

Agent tools

Coordinates are device pixels. With more than one device connected, every tool takes a serial from list_devices.

ToolWhat it does
list_devicesConnected devices and emulators, with their serials
screenshotThe screen as an image, with the scale to device pixels. maxSide sets the image size (default 1024).
ui_treeOn-screen elements with text, description, id and tap position. filter narrows the list.
tap_elementFind an element by text, id or desc and tap it
tap, long_pressTouch at x, y
swipeSwipe from x1, y1 to x2, y2. Swipe up to scroll down.
type_textType into the focused field. ASCII only. submit presses Enter.
press_keyback, home, recents, enter, delete, tab, arrows, power, volume and more, or any Android keycode
current_appThe app and screen in the foreground
list_apps, launch_appFind installed packages and start one
install_apkInstall or update an APK from your computer
logcatRecent logs, filtered by level or text, optionally clearing the buffer
shellRun an adb shell command on the device

Agents act on your device the way you would. Review what you allow, especially shell and install_apk. Most MCP clients ask before each tool call.

Settings

Open Settings and search for DroidBridge, or add these to settings.json.

SettingDefaultWhat it does
droidbridge.scrcpy.maxSize1024Longest side of the mirror in pixels. 0 uses the native resolution.
droidbridge.scrcpy.bitrate"8M"Video bitrate. Raise it for sharp tablets, lower it on slow Wi-Fi.
droidbridge.scrcpy.alwaysOnToptrueKeep the native scrcpy window above other windows.
droidbridge.defaultIp"192.168.1.100"IP address filled in under Connect.
droidbridge.defaultPort"5555"Port filled in under Connect.
droidbridge.adbPath""Custom ADB path. Leave empty to detect it automatically.
droidbridge.scrcpyPath""Custom scrcpy path for the native window. Leave empty to detect it.

Commands

All commands are in the command palette under DroidBridge.

Start Screen Mirror, Stop Screen MirrorEmbedded mirror
Open Screen Mirror in Editor TabMove the mirror to an editor tab
Open Screen Mirror in Native Window, Launch Scrcpy, Launch Scrcpy Screen Off, Stop ScrcpyNative scrcpy window
Connect to Device, Disconnect Device, Pair Device (Manual)Wireless ADB
Set Up AI Agent Access (MCP)Copy setup for Claude Code, Cursor and other agents
Check Binary Status, Download Missing Binaries, Refresh Binary DetectionADB and scrcpy setup
Show LogsOpen the DroidBridge output log

Troubleshooting

The sidebar says Disconnected with a USB device plugged in

Unlock the device and accept the "Allow USB debugging" prompt. If no prompt appears, unplug, revoke USB debugging authorizations in Developer options, and plug in again. Check that adb devices lists the device as device, not unauthorized.

Wireless connection fails

The computer and device must be on the same network. On Android 11 and newer, pair first with the code from Wireless debugging; pairing codes expire after about a minute. The connect port differs from the pairing port.

The mirror stays on Starting or freezes

Stop and start it from the toolbar. On slow Wi-Fi, lower droidbridge.scrcpy.maxSize to 720 or the bitrate to 4M. Show Logs includes the mirror server output.

The video could not be decoded

A few devices produce video that your platform's decoder rejects. Lower droidbridge.scrcpy.maxSize, or use the native scrcpy window.

An agent says ui_tree failed

The screen was animating or showed protected content, such as a banking app or a lock screen. Ask the agent to try again or take a screenshot instead.

Claude Code or Cursor cannot start the MCP server

These clients start the server with Node.js. Install Node.js 18 or newer, run Set Up AI Agent Access again, and replace the old entry with the newly copied one.

Requirements

EditorVS Code 1.104 or newer, or a compatible editor that installs from Open VSX
DeviceAndroid 5.0 or newer with USB or wireless debugging enabled
ComputerWindows, macOS or Linux
Native windowscrcpy, only if you use it
External AI clientsNode.js 18 or newer