dsh-device-deck
zhouatie/dsh-device-deck
Device mirror, emulator manager, and agent tools for DeepSeek Harness.
설치
dsh plugin --profile web add github:zhouatie/dsh-device-deckREADME
Device Deck
Device Deck is a DeepSeek Harness plugin for device work inside the Harness Web UI.
It starts with an Android device mirror, then grows into one control surface for Android, iOS, and Web devices, with the agent able to inspect and drive them.
Status: alpha (
0.6.1). The Android and iOS mirrors are usable. Web mirroring and AI E2E testing are on the roadmap.
Features
Available now
- Device menu in the Session header. One click lists running devices, stopped Android AVDs, iOS simulators, and connected iOS devices. The menu also pairs wireless ADB devices, and it refreshes every 5 seconds while open.
- Android mirror. scrcpy video decoded with WebCodecs in the page.
- Direct control. Tap, swipe, wheel scroll, back, home, recents, text input, and open URL or deep link. The iOS mirror uses a left-edge swipe for back.
- Screen off. The physical display turns off while the mirror is open and turns back on when the mirror closes.
- Android AVD management. List AVDs, start them headless, stop them, and open the mirror once they are ready.
- iOS simulator management. List simulators, boot and shut down them, and open the Simulator app or Device Hub.
- iOS simulator mirroring. The same WebDriverAgent pipeline as devices, with MJPEG video plus tap, swipe, wheel scroll, text input, and screenshots. Simulator builds need no signing.
- iOS device mirroring. List connected iPhones and iPads with
devicectl, then mirror the screen over WebDriverAgent MJPEG. Tap, swipe, wheel scroll, the back gesture, type text, open links, press Home, and capture screenshots. The first launch builds WebDriverAgent. - Wireless ADB. Connect a device with
hostorhost:port. - File transfer (Android). Pick a file on the computer and push it to
/sdcard/Download/on the selected device. - Screenshots. Capture the current screen on Android or iOS, browse the latest shots, preview one, and copy it as a PNG image. Delete one shot or clear the history from the picker.
- Copy page address (Android). Copy the foreground page address: an Activity, a React Native deep link, or a WebView URL.
- Link history. The open-link popover keeps the last 20 links, plus pinned links. Pin, unpin, or delete any of them.
- Screenshot picker. Open it from the composer's
+menu or from the Device screenshot command in the command menu. The chosen shot becomes a draft attachment. - Mirror state. The mirror remembers whether it was open, its position, the selected device, and the link history. Switching Sessions keeps the stream.
- Agent tool.
device_screenshotreturns a screenshot as an image. See Agent tool under Usage. - Bilingual UI. English and Chinese strings follow the Harness locale.
- Shortcut.
Ctrl+Mopens or closes the mirror.
Roadmap
- Web page preview and control.
- AI E2E testing: plan, act, wait, and assert against a device or page.
- Test recording and replay.
- Multi-device decks.
Roadmap items are not implemented. Do not treat them as available features.
Requirements
- DeepSeek Harness
>=0.2.2-rc.1 <0.3.0with plugin support. - Node.js 20 or newer for the Host half.
adbfrom Android platform-tools for Android devices.- Android SDK
emulatorfor AVD management. - macOS with Xcode 15 or newer for iOS simulators and iOS devices. The
command-line tools alone are not enough: the iOS mirror builds WebDriverAgent
with
xcodebuild. - For iOS devices:
iproxy(libimobiledevice), and a device with Developer Mode enabled. An Apple ID must be signed in to Xcode for automatic signing. - For Copy page address: the host clipboard uses
pbcopyon macOS,clipon Windows, andwl-copy,xclip, orxselon Linux. If the host clipboard is unavailable, the browser clipboard is used.
The bundle ships scrcpy-server 3.3.3, so a separate scrcpy install is not
required.
Configuration
The Host half reads these environment variables. All are optional.
| Variable | Purpose | Default |
|---|---|---|
DSH_HOME | Data root. Screenshots, uploads, state, and the WebDriverAgent cache live under $DSH_HOME/device-deck. | ~/.dsh |
DSH_DEVICE_MIRROR_ADB | Path to adb. | Search the common SDK folders, then PATH |
DSH_DEVICE_DECK_WDA_PROJECT | Path to WebDriverAgent.xcodeproj. | Bundled appium-webdriveragent |
DSH_DEVICE_DECK_WDA_BUNDLE_ID | Bundle ID for the WebDriverAgent build. | com.dsh.devicedeck.wda |
DSH_DEVICE_DECK_IOS_TEAM | Apple development team ID for device signing. | Teams from the Xcode preferences, free personal team first |
DSH_DEVICE_DECK_IPROXY | Path to iproxy. | /opt/homebrew/bin, /usr/local/bin, /usr/bin, then PATH |
DSH_DEVICE_DECK_SIMULATOR_APP | Simulator app or Device Hub to open. | Resolved from xcode-select -p |
Install
-
Clone the repository:
git clone https://github.com/zhouatie/dsh-device-deck.git cd dsh-device-deck -
Install dependencies:
pnpm install -
Install this folder as a bundle in Harness. Use Settings → Plugins, or the plugin manager with the absolute path of this folder.
-
Refresh the Harness Web page once.
For a local-folder install, the bundle is linked. Keep the folder in place and
run pnpm install there after dependency changes.
Install from npm or the plugin market
The package is published as dsh-device-deck. Install the current version with:
dsh plugin --profile web add dsh-device-deck@0.6.1
To install from the plugin market, enable
@deepseek-ai/dsh-experimental-plugin-market-bundle, then use
Plugins → Discover → Add index source with:
https://raw.githubusercontent.com/zhouatie/dsh-device-deck/main/market/index.json
Usage
- Open a Session.
- Click the device icon in the Session header, at the top right.
- Pick a running Android device to open its mirror, or start a stopped AVD.
- The Android left rail holds back, home, recents, text, link, file, copy page address, screenshot history, screenshot, and minimize. The iOS rail holds the back gesture, home, text, link, screenshot history, screenshot, minimize, and stop mirror. History appears once a screenshot exists.
- The title bar holds the device switcher, connection status, reconnect, and the drag handle.
- Scroll the mirror with the mouse wheel. Wheel down moves the content down.
- Open the input's
+menu, choose Device screenshot, then pick a shot. The shot is added to the composer; add text before sending. The command menu provides the same picker as Device screenshot. - Send text with ⌘/Ctrl + Enter from the text popover.
To send a file, click the paperclip in the left rail and choose a file. The file
is pushed to /sdcard/Download/<name> on the selected Android device.
To copy the current page address on Android, click the copy icon in the left rail. The address goes to the system clipboard.
Wireless ADB:
192.168.1.102:5555
A bare host is accepted; port 5555 is added automatically.
Agent tool: device_screenshot
The tool captures an Android device screen, or returns a saved screenshot, and attaches it to the conversation as an image.
| Parameter | Type | Meaning |
|---|---|---|
serial | string, optional | Android device serial. Defaults to the device selected in the mirror. |
fresh | boolean, optional | true captures the screen now. The default uses the selected screenshot, or the newest shot of the device. |
The result holds path, serial, width, and height, plus an image
attachment when the attachments service is available. If that service is
unavailable, the tool returns text only.
The tool uses adb. It does not capture iOS devices or simulators.
How it works
- The Host half registers
/api/device-deck/*routes and starts one scrcpy session per Android device. - The Host opens the scrcpy control channel, turns the display power off after the stream starts, and restores it when the last mirror client leaves.
- Video packets travel over same-origin chunked HTTP and are decoded with WebCodecs.
- The Client half registers into the Session header and renders the device menu and the floating mirror. The mirror lives in the root overlay, so a Session switch keeps the stream and canvas.
- For iOS devices, the Host builds and launches WebDriverAgent, forwards ports
with
iproxy, and relays the MJPEG stream. Input actions go through the WebDriverAgent HTTP API. - Screenshots live under
$DSH_HOME/device-deck/screenshots. The newest 30 per device are kept; the selected screenshot is never removed. - Copy page address reads the foreground Activity from
dumpsys, a React Native deep link fromlogcat, or a WebView URL through the WebView DevTools socket. The result is written to the system clipboard. - The mirror keeps its open state, position, selected device, and link history in
browser local storage. The selected screenshot and the last device serial live
in
$DSH_HOME/device-deck/state.json. - File uploads are written to a temporary folder under
$DSH_HOME/device-deck/uploads, pushed withadb push, and deleted after the transfer. - The plugin keeps no cloud service. Device commands go to local
adborxcrun. Screenshots go to the current chat only when you add them to the composer and send them.
Limitations
- The mirror supports Android, iOS devices, and iOS simulators.
- The first iOS device mirror builds WebDriverAgent and takes 2–5 minutes. Build
output is cached under
$DSH_HOME/device-deck/wda. - iOS simulator mirroring also uses WebDriverAgent and builds in about a minute. It needs the full Xcode app, not only the command-line tools.
- iOS device signing uses the Apple ID signed in to Xcode. Free accounts expire after 7 days, so the build must then be repeated.
- The iOS device must be unlocked and stay awake while mirroring. Set Auto-Lock to Never, or the stream shows the lock screen.
- iOS devices cannot be mirrored with the physical screen off. WebDriverAgent has no display power control, unlike the scrcpy channel used on Android.
- The iOS back action uses a left-edge swipe gesture, and works only on screens that support it.
- Open link on iOS devices uses WebDriverAgent's
/urlendpoint and needs iOS 16.4 or later. Older versions fall back to Siri and may fail. - H.264 only. H.265 devices show an error.
- Text input uses
adb shell input textfor ASCII on Android. Other text is pasted through the scrcpy clipboard, so the Android mirror must be open. - One device is mirrored at a time.
- iOS device mirroring depends on WebDriverAgent and keeps one session per device.
- Every cold start installs WDA again and takes 10–40 seconds. Reopening the mirror within 10 minutes reuses the running session without reinstalling.
- Web devices are not supported yet.
- File transfer and copy page address are Android only.
- Copy page address depends on the foreground app. A React Native deep link must
appear in
logcatwithin the last 10 minutes, and an H5 URL needs WebView debugging enabled. - File transfer sends one file at a time, up to 2 GB, to
/sdcard/Download. - Screen-off uses the scrcpy control channel. Some OEM builds may ignore it. If the plugin process crashes while the screen is off, press the power button.
Development
pnpm install
pnpm build
pnpm check
The Client half is authored in src/client/ and bundled into lib/client.js
by scripts/build-client.mjs (esbuild). Do not edit lib/client.js directly.
Run pnpm build after changing src/client/, then commit the rebuilt
lib/client.js and lib/client.js.map.
The Host half is split across host/*.js. index.js only registers the plugin
and its routes. pnpm check rebuilds the Client bundle, checks its syntax, and
loads every Host module.
Layout:
| Path | Purpose |
|---|---|
index.js | Host plugin entry: routes and teardown |
host/ | Host modules: adb, android, config, devices, emulator, http, ios, ios-mirror, screenshots, state, stream, tool, util |
src/client/ | Client source: UI, mirror, picker, store, API, styles |
lib/client.js | Generated Client bundle (esbuild) |
lib/client.js.map | Generated source map |
scripts/ | Build and check scripts |
bin/ | Bundled scrcpy server and its version file |
cordis.patch.yml | Bundle patch |
locale/ | Plugin Manager titles and descriptions |
market/ | Plugin market index and its README |
RELEASING.md | npm release flow |
icon.svg | Plugin icon |
Read CONTRIBUTING.md before opening a pull request.
License
Plugin code: MIT.
The bundled scrcpy server is Apache-2.0. See LICENSE-scrcpy and NOTICE.