Skip to content

About

Mobile iOS / Android Canvas extension for GitHub Copilot App

Resources

Stars

189 stars

Watchers

1 watching

Forks

Latest commit

 

History

462 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mobile Canvas

Install the GitHub Copilot plugin Install from the Visual Studio Marketplace Visual Studio Marketplace installs CI status MIT license

View, create, boot, and interact with local iOS Simulators and Android emulators without leaving GitHub Copilot or VS Code. Mobile Canvas gives your agent the same controls through MCP, so it can deploy, navigate, inspect, and capture evidence on the device you are watching.

Mobile Canvas showing live iOS and Android devices side by side

Live H.264 video at ~58 FPS on iOS and ~50 FPS on Android, with real tap, drag, scroll, and keyboard input. Everything runs locally on loopback; nothing is uploaded anywhere.

Install

GitHub Copilot app

Add this repository as a Copilot plugin marketplace, install mobile-canvas, then open the Mobile Device canvas:

/plugin marketplace add Redth/mobile-canvas-ghcp
/plugin install mobile-canvas@mobile-canvas-ghcp

Reload Copilot after installation. The plugin registers the canvas and all mobile_device_* tools together; there is no separate executable download.

Mobile Canvas running as a maximized canvas in the GitHub Copilot app

VS Code

Install Mobile Canvas from the Visual Studio Marketplace

Install Mobile Canvas from the Visual Studio Marketplace, reload VS Code, and open Mobile from the Activity Bar. The Marketplace automatically selects the package matching your platform.

Mobile Canvas running in the VS Code Activity Bar with a live iOS Simulator

The extension includes the native runtimes and registers the mobile_device_* tools with Copilot Chat automatically. No global tool or mcp.json is required. See the VS Code guide for remote workspace behavior, manual MCP setup, and development commands.

Both hosts still require Xcode for iOS or the Android SDK for Android; see Requirements.

Ailoha opt-in source preview

The production legacy backend remains the default in both hosts. This source preview wires the same scoped Ailoha backend into the installed canvas, VS Code view/Chat tools, and MCP entrypoints. It does not change the product version, identifiers, Marketplace package, or stable runtime channel.

The source now pins the anonymously published @ailoha/cli@0.2.5-preview.7 launcher graph in both hosts, including its exact tarball integrity and source provenance. Once a reviewed host package is installed in a separately qualified environment, start the GitHub Copilot host with MOBILE_CANVAS_BACKEND=ailoha, or set "mobileCanvas.backend": "ailoha" in VS Code's application settings and reload the window. Without that prepared, exact-pinned public graph, opt-in reports unavailable rather than starting the legacy engine. Refreshed Mobile Canvas embedded-web native release artifacts and normal installed-host routing remain separate gates; this SDK source/package qualification is not a production cutover or a normal-install-ready release.

The opt-in covers authoritative provider/runtime/device-type/template catalogs, compatible iOS/Android create+boot, inventory/selection, advertised start/stop/reboot, PNG screenshots, observed-geometry tap/held-press/swipe/scroll, and complete ALHV H.264 access units. Device control and System inspection require no app instrumentation; App inspection does. Creation uses exact host/provider catalog choices and one canonical operation; accepted retries do not submit another create or boot. Destructive reset/delete without scoped human consent remains unsupported where genuine scoped approval is unavailable. The read-only System lens uses the selected Target Host target; canonical app inventory, launch, terminate, cold relaunch and Android app-op reads use native target identities. Source-conditional staged installation remains unsupported in installed hosts until a compatible approved public runtime and host artifact capability are available; uninstall and app-op mutation use source-conditional fenced CLI actions with captured native app evidence, scoped human approval and effective readback. They remain unsupported in installed hosts until the compatible reviewed public CLI and native host capabilities are packaged; ordinary uninstall/app-op routes cannot substitute. The App lens requires an explicitly selected verified native runtime instance in the canonical named context. Workspace application evidence cannot bind an agent. Recording uses the verified scoped CLI only when recovery is positively advertised; keyboard/buttons and broader controls remain unsupported. See the Ailoha adapter contract for ownership, setup, package evidence and remaining gates.

Give Copilot hands and eyes

Mobile Canvas lets an agent work on the same device you see. Ask Copilot to reproduce a bug, navigate a flow, capture evidence, or inspect accessibility without switching tools or wiring up a separate MCP server.

Boot an iPhone simulator, install my app, and walk through sign in.
Find the Settings button on the Android emulator and tap it.
Take a screenshot of the current screen and describe any layout issues.

Agent actions automatically select the target device. An animated cursor and accent glow make every automated interaction visible, so you can follow along and take over at any time.

Copilot interacting with an iOS Simulator in Mobile Canvas Copilot interacting with an Android emulator in Mobile Canvas

What it does

The following feature list describes the production legacy default, not the bounded Ailoha opt-in preview.

Device management

  • Discover installed runtimes/system images, device types, and existing devices.
  • Create and automatically boot devices headlessly, then restart, shut down, show their native window, erase, or delete them. Showing an Android emulator restarts it with its window enabled.
  • Erase and delete always require an explicit confirmation.

Live interaction

  • Live Annex-B H.264 decoded with WebCodecs, with automatic PNG polling whenever the stream is unavailable.
  • Tap, long press, drag, swipe, wheel scroll, text, keys, and device buttons, mapped correctly at every view scale and orientation.
  • PNG screenshots and bounded video recordings written to disk.

Agent control

  • 24 canvas actions for common device operations, plus 61 MCP tools covering device, app, file, diagnostics, settings, and hardware operations. See the compatibility baseline for the exact names and migration invariants.
  • Every target-changing call returns the full device record, including the udid/serial you need to hand to a deploy command.
  • When an agent drives the device, the canvas shows an accent-coloured glow and an animated cursor so a human watching can tell automation from their own input.

Requirements

Requirement
iOS macOS and a full Xcode installation with Simulator runtimes
Android Android SDK with emulator and adb; avdmanager and Java are needed only to create or delete AVDs
Optional iOS fallbacks idb (provides idb_companion), plus Screen Recording and Accessibility permission for ScreenCaptureKit window capture

The bundled mobile-screencap helper provides iOS touch, keyboard, buttons, rotation, accessibility hierarchy, and direct video capture. Xcode 26 uses Simulator.app; Xcode 27 uses Device Hub. Neither visible app needs to be open for headless input or hierarchy reads.

Android-only workflows do not require Xcode. When Xcode is unavailable, Mobile Canvas keeps Android emulators usable and marks iOS as unavailable.

Likewise, Java is not required to run or control existing Android emulators. It is used indirectly by avdmanager only when Mobile Canvas creates or deletes an AVD.

Meta's idb metapackage is not required for ui_tree, ui_find, or ui_tap. It remains an optional compatibility input fallback and the final live-video fallback if the bundled native paths cannot start. Mobile Canvas only reports its absence when an operation actually needs it. To install it, current Homebrew versions require explicitly trusting the third-party tap:

brew tap facebook/fb
brew trust facebook/fb
brew install facebook/fb/idb

Then add the installed executable to your shell environment. For zsh:

echo "export IDB_COMPANION_PATH=\"$(brew --prefix idb-companion)/bin/idb_companion\"" >> ~/.zshrc
source ~/.zshrc

Confirm that the configured path points to the executable:

test -x "$IDB_COMPANION_PATH" && "$IDB_COMPANION_PATH" --version

Android emulators must be started with -gpu host. A software-rendered AVD drops video from ~50 FPS to ~3 FPS.

Platform iOS Simulator Android emulator Video
macOS yes yes H.264
Windows no yes screenshot polling
Linux no yes screenshot polling

iOS control requires Xcode's simctl and the bundled CoreSimulator helper, so it is macOS-only. Android works everywhere; hardware H.264 encoding currently runs through the same macOS helper, so elsewhere the canvas falls back to screenshot polling.

CLI and source installs

From source

git clone https://github.com/Redth/mobile-canvas-ghcp
cd mobile-canvas-ghcp
./scripts/build.sh      # Native AOT binary + universal Swift capture helper
./scripts/install.sh    # Installs into ~/.copilot/extensions/mobile-canvas

Reload Copilot afterwards so it picks up the extension. Source installs register as Mobile Device (Local) (mobile-device-local), so a development build can coexist with the marketplace plugin without registering the same canvas ID twice.

As a .NET global tool

For a plain CLI/MCP install without the canvas:

dotnet tool install -g MobileCanvas.Tool

Usage

Ask Copilot to open the Mobile Device canvas, or open it from the canvas picker. Select a running device, or create one from an installed runtime.

From the CLI:

mobile-canvas devices list --json
mobile-canvas devices boot <id> --wait
mobile-canvas input tap <id> --x 100 --y 200
mobile-canvas screenshot <id> --output shot.png
mobile-canvas host status
mobile-canvas guide

Every query command accepts --json and --schema, so output composes safely with jq.

Agent tools

All 24 tools are available both as canvas actions and as MCP tools named mobile_device_*:

Group Tools
Discovery list, get, catalog, select, get_selected, display
Lifecycle create, boot, shutdown, restart, reveal, erase, delete
Input tap, long_press, swipe, type_text, press_key, press_button, rotate
Media screenshot, recording_start, recording_stop, recording_status

A typical agent flow is list → select → read udid from the result → deploy your app to that exact device → drive it with the input tools.

VS Code integration

The Marketplace installs a self-contained package on supported desktop targets; the universal fallback downloads and verifies its pinned runtime on first use. Agent actions select and animate the same device in the live Activity Bar view. The view follows the active VS Code theme while preserving the GitHub canvas appearance elsewhere. Attach the selected device, a fresh screenshot, or its accessibility tree to chat with #mobileDevice, #mobileScreenshot, or #mobileUiTree.

The extension runs locally for Remote SSH, Dev Containers, and Codespaces. vscode.dev is unsupported.

Architecture

GitHub Copilot app        VS Code extension          CLI / other agent
  └─ extension.mjs          ├─ Activity Bar webview    └─ mobile-canvas mcp
       │ canvas actions     └─ MCP context proxy              │
       └──────────────────┬───────────────┬────────────────────┘
                          ▼
                  mobile-canvas host     (per-user, per-protocol singleton)
                    ├─ HTTP + WebSocket UI transport
                    ├─ per-panel selected-device state
                    └─ platform backends
                         ├─ iOS      simctl + bundled CoreSimulator helper + optional idb
                         └─ Android  emulator gRPC + adb

The host is started on demand, binds only to 127.0.0.1, and authenticates canvas panels with a scoped reload grant exchanged for a rotating session cookie. The grant remains in the URL fragment so a host-restored renderer can reconnect without exposing the credential in an HTTP request. It exits after an idle grace period and never shuts down a device implicitly, so detaching a panel is always safe.

GitHub Copilot and VS Code releases using the same host protocol share the newest compatible host. Hosts are isolated under ~/.mobile-canvas/hosts/v<protocol>/, so an older installation using the legacy location and future incompatible protocol versions can run at the same time without replacing each other's process. A release that makes a backwards-incompatible host API change must bump MobileCanvasProtocol.Version; package versions alone do not create extra hosts.

Video is deliberately split from input on both platforms:

Concern iOS Android
Frames CoreSimulator IOSurface (ScreenCaptureKit fallback) emulator gRPC streamScreenshot
Encode VideoToolbox H.264 same VideoToolbox H.264
Input bundled CoreSimulator HID (Indigo/DTUHID), GSEvent rotation; optional idb fallback emulator gRPC streamInputEvent
Lifecycle simctl emulator/avdmanager + gRPC

Raw Android frames are encoded before they reach the browser, so only ~1-2 Mbps crosses to the canvas instead of the 41-577 MiB/s the emulator emits.

All .NET subprocess launches go through IProcessRunner: RunAsync collects text output, while Start(ProcessStartInfo) returns a caller-owned process for binary ADB transfers and long-lived emulator, capture, HID, recording, and host sessions. Callers keep responsibility for draining pipes, cancellation, and cleanup; binary stdout is never decoded as text. Custom runners must implement Start to support those workflows (the default rejects them rather than bypassing the runner). Both UI hosts use this same backend boundary.

Development

dotnet build MobileCanvas.slnx
dotnet test  tests/MobileCanvas.Tests/MobileCanvas.Tests.csproj
npm ci --prefix vscode --ignore-scripts
npm test --prefix vscode
npm run package --prefix vscode
npm run ailoha:manifest -- --output .build/ailoha-source-manifest.json
./scripts/build.sh          # builds one architecture into .build/bin/<rid>
./scripts/release.sh        # rebuilds macOS release assets for local validation

Two things to know before you change anything:

  • Web assets are embedded resources. Any change to web/ needs a republish, not a file copy. extension.mjs is the opposite — it is copied directly and is not part of the binary.
  • dotnet publish does not build the Swift helper. scripts/build.sh builds both. A stale helper fails only later, at stream start; check it with mobile-screencap --help and confirm accessibility, framebuffer, hid, hid-doctor, and Android's encode subcommands exist.

The Ailoha source manifest is a deterministic inventory of every tracked or unignored source file, its destination under imports/mobile-canvas, and its byte-exact hash. It also records the current backend operations, API/WebSocket routes, MCP tools, and canvas actions so Ailoha can measure feature parity against code. The aggregate snapshot authenticates the destination root, every complete import record, and that surface inventory, so neither mapping nor parity metadata can drift independently from the imported source. Repository attributes require LF text checkouts so clean snapshots are byte-stable across platforms. Ailoha uses the manifest to pin and verify imports while this repository remains the implementation source of truth. Pass --require-clean for an importable release snapshot.

The approved Ailoha integration roadmap describes the intended engine migration; it is not a claim that the cutover has been implemented. The compatibility baseline records the current product identities, tool/action inventory, and behavior that migration adapters must preserve.

Changing src/ or native/ requires the Release runtimes workflow. It builds each Native AOT RID on its native OS, publishes checksummed release assets, and packages both host extensions from those exact binaries. See How the executable ships.

License

MIT. See LICENSE.

About

Mobile iOS / Android Canvas extension for GitHub Copilot App

Resources

Stars

189 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages