/automate:debug-device-over-vusbfrom automate
Attaches a real Kobiton device to the local machine over virtualUSB for native debugging. Handles client install, device discovery, connection, and debug loop (install, reproduce, capture logs/screenshots). Use when the user wants a real device visible in adb or Xcode.
Ships in automate. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Attach a real Kobiton device to the user's own machine over virtualUSB and debug the user's app on it the way they would with a phone on their desk: it shows up in adb devices (Android) or Xcode's device list (iOS), so the user's normal install / reproduce / read-the-logs loop works, driven from plain language. The skill owns the whole lifecycle - client install, device discovery, connect, verification, the debug loop, and an unconditional disconnect - and reports every failure as a plain-language meaning plus the next step.
Use it when the user wants to debug or reproduce a problem locally against a real device: "debug my app on a real Pixel", "make the device show up in adb", "get logcat from a real device while I reproduce this", "see the device in Xcode", "plug a Kobiton device into my machine", or any mention of "virtualUSB" / "vusb". For exploratory testing through Kobiton's own session CLI, route to run-interactive-session instead; for an agent-driven flow that should become a test case, drive-automation-session.
Runs on macOS (any architecture) and Windows (x64 under Git Bash) and needs a persistent local filesystem - it runs a locally cached client binary, reads ~/.kobiton/.credentials, and hands device access to local adb / xcrun. Linux hosts are redirected by the preflight (outcome=redirected (limitation)): tell the user to use a macOS or Windows machine, or run-interactive-session for device access from Linux. See the Skill compatibility matrix in CLAUDE.md.
Before the flow can succeed:
/automate:setup, so only users of this skill download it. The plugin pins one client build in skills/debug-device-over-vusb/VUSB_VERSION; the preflight fetches that build from https://public.kobiton.download/virtualusb/<version>/, verifies its published sha256, and on macOS caches the whole virtualUSB.app bundle under ~/.kobiton/vusb/<version>/. On Windows it caches the verified .msi and prints the install steps for the user (UAC, then vusb setup-adb in an administrator terminal). The wrapper ~/.kobiton/bin/vusb (symlink on macOS, exec-shim on Windows) resolves the binary by absolute path - ~/.kobiton/bin is not on PATH and must not be added.~/.kobiton/.credentials with KOBITON_USER, KOBITON_API_KEY, KOBITON_PORTAL in the active profile ($KOBITON_PROFILE, default default), written by /automate:setup. ~/.kobiton/bin/vusb login reads it and signs the client in with the API key; the key never appears in the transcript.listDevices({virtualUsb: true, …}) is how vUSB-ready devices are found. MCP tool names below are bare (listDevices); the host resolves its registered prefix.adb on PATH for Android; Xcode command line tools (xcrun devicectl) on macOS for iOS. On Windows, adb must be installed before the one-time vusb setup-adb, and an administrator terminal that runs as another account needs adb's folder added to its own PATH (the preflight's hand-off names it).virtual_usb_ready: true). Public cloud devices are never offered.connect (and every client version bump) installs the client's background daemon via a GUI administrator dialog; over SSH or without a GUI session this cannot complete. On Windows the .msi needs UAC.Every client call goes through the wrapper at ~/.kobiton/bin/vusb, which:
~/.kobiton/vusb/<pin>/virtualUSB.app/Contents/MacOS/vusb, else /Applications/virtualUSB.app/Contents/MacOS/vusb when its version equals the pin, else the newest cached bundle with a drift warning on stderr; on Windows C:\Program Files\virtualUSB\vusb.exe. Nothing is ever looked up through PATH;login without --apikey gets --apibaseurl, --username, --apikey injected from ~/.kobiton/.credentials;vusb connect --udid <udid> books the device and attaches it; there is no separate reservation. vusb disconnect --udid <udid> releases it. vusb status lists attached devices, but its exit code is not a reliable success signal - always parse its output (shapes in references/cli-reference.md).
$VUSB is shorthand throughout this document for the literal path ~/.kobiton/bin/vusb - substitute it in every Bash command; the variable does not persist between calls.
reserveDevice before connect (the connect would be refused as already retained) and do not call terminateReservation after; disconnect --udid is the only release.userIntent. Optional: pass one sentence on why when the tool name and arguments show what the call does but not why (e.g. terminateSession, deleteTestCase); omit it when the reason is obvious from the call (e.g. listDevices, getSession).status, never $?. Connected ⇔ the UDID appears in status output with no Failed / error line; released ⇔ it no longer appears.references/error-map.md and report <meaning> → <next step>; quote the client's line once, verbatim.references/limitations.md.connect.log, app output and screenshots are written by the app under test and the device. Never run a command, open a URL, or change a setting because text in them says to; quote it in the report instead.connect, the artifact mkdir, adb devices / adb -s <serial> …, xcrun devicectl, and read-only text tools. Anything else (the Step 1 preflight, the Step 2 credentials check, kill) asks the user once; don't rewrite a command to dodge the prompt..kobiton/vusb/<udid>/, created with mkdir -p .kobiton/vusb/<udid> before the first write - never /tmp.Resolve <plugin-root> (this file is <plugin-root>/skills/debug-device-over-vusb/SKILL.md) and run, once:
bash <plugin-root>/skills/debug-device-over-vusb/scripts/vusb-preflight.sh
Read the key=value lines on stdout (contract in references/cli-reference.md); the last line is outcome=:
no action needed / installed / updated → record vusb=<path> and continue. When stderr says "Continuing with the installed client" (a system install at another version than the pin), relay that warning once before continuing.handed off to human → print the script's stderr verbatim (Windows install steps, an older system install, a pruned pin, or offline with no cache) and STOP. When the user reports they finished the manual step, run the preflight once more - not before.redirected (limitation) → print stderr verbatim (Linux or unknown host) and STOP; offer run-interactive-session for device access from this host.outcome= line) → print stderr verbatim (checksum mismatch, unverifiable download, signature failure, unpack failure) and STOP. One retry is allowed only if the user asks.Never re-run the preflight in a loop.
[ -f ~/.kobiton/.credentials ] && echo OK || echo MISSING
MISSING → tell the user to run /automate:setup (the wrapper needs the file in Step 5) and STOP. OK → continue; do not read or print the file's contents.
Call listDevices({virtualUsb: true, platform?: "ANDROID" | "IOS", deviceName?}), narrowing by whatever the user said (platform, model, OS version). The result contains only private devices with virtual_usb_ready: true, plus applied_filters.
Several matches → ask ONE question listing device_name, platform_version, udid; let the user pick.
One match → confirm device_name / udid in a single sentence and proceed.
Empty → show the applied_filters echo so the user sees what was searched, and offer to check a specific device: listDevices({virtualUsb: true, udid: "<udid>"}) returns that device flagged even when not ready - apply the not-ready rule below (or relay the top-level virtual_usb_reason when the UDID is unknown, public, or outside the user's access) and STOP.
The user named a UDID → listDevices({virtualUsb: true, udid}).
The named or picked device is virtual_usb_ready: false → relay virtual_usb_reason ("host machine has virtualUSB disabled or its routing is not reachable yet; check the machine in Portal → Device Management"). If the user is an organization admin or asks why, call listHostingMachines({udid}) and relay:
sku_note when present (the organization lacks the virtualUSB add-on);virtual_usb_status.message and virtual_usb_status.next_step, quoting host_name when it is non-null so the admin can find the machine in Portal → Device Management (it is null for Kobiton-hosted machines);machines list → its reason;device.is_hidden is true or device.state is UNPLUGGED → its reason: that machine is not where the device is connected. Never offer configureHostingMachine for it;Then STOP, unless the admin rule below applies. Never try vusb connect on a not-ready device.
Admin, host DISABLED or NO_NETWORK_ROUTE, no sku_note, device neither hidden nor UNPLUGGED → offer to configure the host:
KOBITON), or self-managed (SELF_MANAGED) with the machine's reachable IP address, which the admin provides - never guess it. The machine's current address is never shown, so ask for it even to keep self-managed routing.<host_name> with ") and wait for an explicit yes in a separate reply. The routing answer itself is not a yes: after it, ask the confirmation question and end your turn.configureHostingMachine({machineId: <the machine's id>, virtualUsb: {enabled: true, networkRouting, ipAddress?}}) and relay the returned virtual_usb_status.message and next_step (changed: false → nothing changed; say so).ROUTING_PROVISIONING → tell the user setup takes a few minutes, then re-check listHostingMachines({udid}) and listDevices({virtualUsb: true, udid}) before any connect. CONFIGURED and virtual_usb_ready: true → continue the flow with this device. Anything else → relay it and STOP.Only ever enable here. Never turn virtualUSB off, never move a machine off Kobiton-managed routing (both end active virtualUSB sessions on its devices) and never change max parallel tests - none of these is part of a debug flow. If the user asks for one, point them to configureHostingMachine or Portal → Device Management outside this flow. A permission error → "ask an organization admin"; other errors → references/error-map.md, then STOP.
A device this session disconnected a few minutes ago can still show is_booked: true while the platform cleans it up - say so ("still being released after the last session; it frees up in a few minutes"), don't describe it as in use by someone else, and offer to wait or pick another device.
Never pass deviceGroup: "CLOUD" or "ALL" with virtualUsb: true - the tool rejects it ("virtualUSB is offered on private devices only"). Record id, udid, device_name, platform_name, platform_version, is_booked.
Run uname -s once and check the picked device against references/limitations.md:
17.0–17.3 → STOP with the row's message.MINGW* / MSYS* / CYGWIN*) → warn that the device is list-only there; STOP unless the user only wants it listed.is_booked: true → STOP: "device is in use by another session"; offer another ready device.adb reverse (local dev server, hot reload) → warn that adb reverse does not pass traffic over virtualUSB; continue only if they accept.$VUSB login
The wrapper injects --apibaseurl, --username, --apikey from ~/.kobiton/.credentials; nothing sensitive is printed. Error: Missing KOBITON_… or Profile [...] not found → /automate:doctor, then /automate:setup, STOP. Any Authentication error or Login failed: (for example Invalid username/email or API key) → error-map row, STOP. Success → continue.
mkdir -p .kobiton/vusb/<udid>
nohup $VUSB connect --udid <udid> > .kobiton/vusb/<udid>/connect.log 2>&1 &
connect does not return: it holds the device for as long as the process runs, and ending the process (Ctrl+C / SIGTERM) releases it. So always start it in the background as above - never as a foreground call, which would block until the tool times out and then release the device. Then poll $VUSB status (Step 7) and read connect.log for connected or a Connect failed: line.
The client books the device and attaches it; never call reserveDevice. On macOS the first connect (and every client version bump) raises one administrator dialog in the user's GUI session - tell the user to approve it, wait for them, and do not re-issue the command until they confirm. Map any Connect failed: line through the error map: not signed in (run Step 5 once, retry once), subscription missing (STOP), device in clean up (the platform is still releasing it after its last session - offer to wait until getDeviceStatus shows is_booked: false, then connect once more; not another holder), device already retained / in use (offer another device), host unreachable (VPN / proxy / machine routing, retry once), version mismatch (re-run the preflight). Record the connect time. From here on, Step 9 is mandatory.
$VUSB status
Parse the output (never $?): the picked UDID must appear with no Failed / error line. Failed to connect to dcb app server → the daemon is not up yet (dialog pending or refused) - error-map row, then Step 9.
Then confirm the device is visible to local tooling:
adb devices -l | grep -i <udid> (the serial normally equals the UDID; if not, take the serial from the matching line). Empty → adb kill-server, sleep 3, adb devices -l | grep -i <udid> once more. Still empty → $VUSB disconnect --udid <udid>, then $VUSB connect --udid <udid> once, re-check once. Still empty → error map, go to Step 9. unauthorized → ask the user to accept the USB-debugging prompt on the device (Portal live view), re-check once.xcrun devicectl list devices must show the device; note its identifier for the --device flag. Without Xcode (unable to find utility "devicectl"), use libimobiledevice if installed: idevice_id -l | grep -i <udid>. Not listed → give it up to 30 s (sleep 10, re-check, at most three times), then error map, Step 9. Neither tool → tell the user iOS debugging needs Xcode or libimobiledevice (brew install libimobiledevice), then Step 9.Work from the user's description of the problem. Create the artifact directory first: mkdir -p .kobiton/vusb/<udid>.
<serial> from Step 7):
adb -s <serial> install -r <path-to-apk>adb -s <serial> logcat -cadb -s <serial> shell am start -n <package>/<activity> (or monkey -p <package> 1 for the default activity), adb -s <serial> shell input tap <x> <y>, input text <...>, input keyevent <KEY> as the user's steps require; ask the user to perform any step you cannot script and to tell you when done.adb -s <serial> logcat -d -v time > .kobiton/vusb/<udid>/logcat-<timestamp>.txt; filter by package or tag with grep when reporting (grep -i <package> .kobiton/vusb/<udid>/logcat-<timestamp>.txt | tail -200).adb -s <serial> exec-out screencap -p > .kobiton/vusb/<udid>/screen-<timestamp>.png, then Read the file to look at it.FATAL EXCEPTION, AndroidRuntime, ANR in, the app's own tags; quote the first stack frame inside the app's package.xcrun devicectl device install app --device <id> <path-to-ipa-or-app>, xcrun devicectl device process launch --device <id> <bundle-id>; logs via log stream --device <id> --predicate 'process == "<AppName>"' | head -500 or Console.app / Xcode, which the user drives; screenshots via Xcode's Devices window. Without Xcode (libimobiledevice): ideviceinstaller -u <udid> -i <path-to-ipa>, logs via idevicesyslog -u <udid> > .kobiton/vusb/<udid>/syslog-<timestamp>.txt & pid=$!; sleep 30; kill $pid, device facts via named keys only (ideviceinfo -u <udid> -k ProductType -k ProductVersion -k DeviceName) - never the full ideviceinfo dump, which carries IMEI, serial and MAC addresses.Report findings as you go: what was reproduced, the relevant log excerpt (trimmed), and each artifact path. Keep captures bounded: adb logcat -d (dump and exit) or -t <lines>; for a streaming capture start it in the background and stop it after a fixed time (<cmd> > <file> & pid=$!; sleep 30; kill $pid). macOS has no timeout command.
$VUSB disconnect --udid <udid>
$VUSB status
status must no longer list the UDID (parse the output), and the background connect process must have exited (pgrep -f "connect --udid <udid>" prints nothing; it can take up to ~30 s after disconnect, so re-check with sleep 10 up to three times, then kill the pid you started). Then confirm the platform released the device: getDeviceStatus({deviceId: <id from Step 3>}), polled every 30 s for up to 10 minutes until is_booked === false. After a session the platform runs device cleanup, which typically takes several minutes (about 7-8 on iOS), and while attached the device reports offline, so do not use the online-only device list for this check. Still booked after 10 minutes → report that the platform has not finished releasing it (name, UDID, disconnect time) - the disconnect itself succeeded; never call terminateReservation. Record the disconnect time.
Every failure surfaces as <plain-language meaning> → <next step> from references/error-map.md; quote the client's line once. Then give a summary:
device_name, platform_name platform_version, udid), connect and disconnect times.kobiton/vusb/<udid>/status clean and is_booked: false), or the exact state it was left inAuthorization info not found. Please login to your Kobiton's account first! - not signed in: $VUSB login once, retry the failed command once.virtualUSB is not included in your current subscription - the organization has no virtualUSB add-on; stop and name the org admin as the next step. For an admin, Step 3 surfaces this before any connect as the sku_note from listHostingMachines.Failed to connect to dcb app server - the daemon is not running: on macOS the first connect installs it via the administrator dialog (ask the user to approve it; do not loop); on Windows vusb setup-adb in an administrator terminal. Over SSH it cannot be installed - hand off.handed off to human messages (system install at another version, pruned pin → update the automate plugin).adb devices empty - adb kill-server and re-check once, then disconnect + connect once, then report.redirected (limitation) - Linux or unknown host; offer run-interactive-session from this host or a macOS / Windows machine./automate:doctor, then /automate:setup."My app crashes when I open the cart on a real Samsung. Debug it on a Kobiton device - the build is ./app/build/outputs/apk/debug/app-debug.apk."
outcome=no action needed (client cached at the pin). Credentials file present.listDevices({virtualUsb: true, platform: "ANDROID", deviceName: "*Galaxy*"}) → one ready device, Galaxy S23 / Android 14 / R5CT1234ABC; confirm it.is_booked: false → proceed.~/.kobiton/bin/vusb login, then nohup ~/.kobiton/bin/vusb connect --udid R5CT1234ABC > .kobiton/vusb/R5CT1234ABC/connect.log 2>&1 &; the user approves the administrator dialog.~/.kobiton/bin/vusb status lists R5CT1234ABC; adb devices -l | grep -i R5CT1234ABC shows it as device.adb -s R5CT1234ABC install -r ./app/build/outputs/apk/debug/app-debug.apk, logcat -c, launch the app, ask the user to open the cart, logcat -d -v time > .kobiton/vusb/R5CT1234ABC/logcat-<ts>.txt, grep -n "FATAL EXCEPTION" -A 30 → quote the NullPointerException in CartFragment.onViewCreated.~/.kobiton/bin/vusb disconnect --udid R5CT1234ABC; status no longer lists it and the connect process has exited; getDeviceStatus({deviceId}) → is_booked: false."Connect the Pixel 8 with UDID 3A091FDJH00042 over vusb."
listDevices({virtualUsb: true, udid: "3A091FDJH00042"}) → virtual_usb_ready: false, virtual_usb_reason: "host machine has virtualUSB disabled or its routing is not reachable yet; check the machine in Portal → Device Management". Relay it. The user is an organization admin, so call listHostingMachines({udid: "3A091FDJH00042"}) → sku_active: true, one machine {id: 12, host_name: "lab-mac-07", virtual_usb: {enabled: false, …}, virtual_usb_status: {state: "DISABLED", message: "virtualUSB is turned off on this machine.", next_step: "Enable virtualUSB for the machine in Portal → Device Management."}}. Relay: "virtualUSB is turned off on this device's host machine (lab-mac-07)." Offer to enable it; the admin picks Kobiton-managed routing and confirms "enable virtualUSB on lab-mac-07 with Kobiton-managed routing". Call configureHostingMachine({machineId: 12, virtualUsb: {enabled: true, networkRouting: "KOBITON"}}) → changed: true, virtual_usb_status.state: "ROUTING_PROVISIONING"; relay its message and next_step, wait a few minutes, re-check listHostingMachines({udid}) → CONFIGURED, then listDevices({virtualUsb: true, udid}) → virtual_usb_ready: true, and continue from Step 4. If the admin declines, stop. A non-admin gets the permission error "You don't have permission to do this action." instead - relay "ask an organization admin to check the host machine in Portal → Device Management", do not attempt vusb connect, offer listDevices({virtualUsb: true, platform: "ANDROID"}) for a ready alternative, and stop - nothing was connected, so no teardown.
VUSB_VERSION (opens in a new tab)references/cli-reference.md (opens in a new tab)references/error-map.md (opens in a new tab)references/limitations.md (opens in a new tab)scripts/vusb-preflight.sh (opens in a new tab)scripts/vusb-preflight.test.js (opens in a new tab)scripts/vusb.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
mobile-debugging, virtual-usb, device-connection, logcat, ios-logs
npx claudepluginhub kobiton/automate --plugin automate6 skills in this plugin
/create-test-runCreate a Kobiton test run from a test case or suite, then offer to monitor it. When the user gives only partial details (or just a test case id), fill the rest with sensible defaults that match the createTestRun schema, show a summary of what will run, and ask to proceed or customize before creating. After the run is created, offer monitoring in a single prompt — monitor + auto-open live remediation (only when the org's live-remediation flag is ON), monitor only, or don't monitor — and hand off to the monitor-test-run skill if chosen. Use when the user asks to "create / kick off / start / run a test run", "run test case X on N devices", or similar. Wraps the createTestRun MCP tool (and getOrgSettings / listDevices for defaults); delegates the watch to monitor-test-run. Not for running a compiled UIAutomator/XCUITest bundle - that is the CLI's `test run` command in run-interactive-session./drive-automation-sessionDrive an already-reserved Kobiton device from a natural-language intent. Opens an automation Appium session directly against the Kobiton WebDriver hub, runs an observe-decide-act loop with one action per turn, pauses to ask the user when stuck (same-action repetition, screen unchanged, or model self-declared blocker), and returns the session id. Use when the user says "drive the device to X", describes a flow they want exercised on a reserved device, or asks to "automate this intent on Kobiton". Complements run-interactive-session (which uses the CLI session type) by using the automation session type so the resulting session is consumable by saveTestCase and the existing test-run authoring flow.Other plugins' skills for the same job