Mirroir — iPhone Control via iPhone Mirroring
Use mirroir to control a real iPhone through macOS iPhone Mirroring. Screenshot, tap, swipe, type, launch apps, record video, OCR the screen, and run multi-step automation scenarios — all from the terminal. Works with any app on screen, no source code or jailbreak required.
When to Use
✅ USE this skill when:
- - User wants to interact with their iPhone (tap, swipe, type, navigate)
- Sending an iMessage, WhatsApp, or any messaging app message on the iPhone
- Adding calendar events, reminders, or notes on the iPhone
- Testing a mobile app (Expo Go, TestFlight, App Store apps)
- Taking a screenshot of the iPhone screen
- Recording a video of an iPhone interaction
- Reading what's on the iPhone screen (OCR)
- Automating a multi-step iPhone workflow (login flows, app navigation)
- Checking iPhone settings or toggling network modes
- Launching an app on the iPhone
- User says "on my phone", "on my iPhone", "on iOS"
When NOT to Use
❌ DON'T use this skill when:
- - User wants to send iMessage from macOS Messages.app → use
imsg skill - User wants to manage Apple Reminders on macOS → use
apple-reminders skill - User wants to manage Apple Notes on macOS → use
apple-notes skill - User wants to automate macOS UI → use
peekaboo skill - User wants to control a camera → use
camsnap skill - The task can be done entirely on macOS without the iPhone
- iPhone Mirroring is not connected (check with
mirroir status first)
Requirements
- - macOS 15+ (Sequoia or later)
- iPhone connected via iPhone Mirroring
- Karabiner-Elements (installed automatically by the mirroir installer)
- Screen Recording and Accessibility permissions granted
Setup
After installing, run the setup to configure the helper daemon and Karabiner:
CODEBLOCK0
Approve the Karabiner DriverKit extension if prompted: System Settings > General > Login Items & Extensions — enable all toggles under Karabiner-Elements.
MCP Server Configuration
Mirroir is an MCP server. Configure it in your OpenClaw MCP settings:
CODEBLOCK1
Or if installed via Homebrew, use the binary path directly:
CODEBLOCK2
Core Workflow
The typical workflow for any iPhone task:
- 1. Check status:
mirroir status — verify iPhone Mirroring is connected - See the screen:
mirroir describe_screen — OCR the screen to find tap targets - Act: tap, swipe, type, launch apps based on what's visible
- Verify: take a screenshot or describe the screen again to confirm
Available Tools (26 total)
Screen & Vision
- -
screenshot — Capture the iPhone screen as PNG - INLINECODE10 — OCR the screen, returns text elements with exact tap coordinates plus a grid-overlaid screenshot
- INLINECODE11 — Report portrait/landscape and window dimensions
- INLINECODE12 — Connection state, window geometry, device readiness
- INLINECODE13 — Full diagnostic: mirroring, helper, Karabiner, screen capture
Input
- -
tap x y — Tap at coordinates - INLINECODE15 — Two rapid taps (zoom, text selection)
- INLINECODE16 — Hold tap for context menus (default 500ms)
- INLINECODE17 — Swipe between two points
- INLINECODE18 — Slow drag for icons, sliders
- INLINECODE19 — Type text via Karabiner virtual keyboard
- INLINECODE20 — Send special keys (return, escape, tab, arrows) with optional modifiers (command, shift, option, control)
- INLINECODE21 — Trigger shake gesture (Ctrl+Cmd+Z) for undo/dev menus
Navigation
- -
launch_app "AppName" — Open app via Spotlight search - INLINECODE23 — Open URL in Safari
- INLINECODE24 — Go to home screen
- INLINECODE25 — Open app switcher
- INLINECODE26 — Open Spotlight search
- INLINECODE27 — Scroll until a text element becomes visible via OCR
- INLINECODE28 — Force-quit app via App Switcher
Recording & Measurement
- -
start_recording — Start video recording of the mirrored screen - INLINECODE30 — Stop recording and return the .mov file path
- INLINECODE31 — Time a screen transition
Network & Scenarios
- -
set_network mode — Toggle airplane/Wi-Fi/cellular via Settings - INLINECODE33 — List available YAML automation scenarios
- INLINECODE34 — Read a scenario file
Coordinates
Coordinates are in points relative to the mirroring window's top-left corner. Always use describe_screen first to get exact tap coordinates via OCR. The grid overlay helps target unlabeled icons (back arrows, gears, stars).
Examples
Send an iMessage on iPhone
CODEBLOCK3
Test a login flow
CODEBLOCK4
Running late — check Waze ETA and notify the team on Slack
CODEBLOCK5
Record a bug reproduction
CODEBLOCK6
Scenarios (YAML Automation)
Mirroir supports YAML scenario files for multi-step automation flows. Scenarios describe intents, not coordinates — the AI reads the steps and executes them using the MCP tools above, adapting to what's actually on screen.
CODEBLOCK7
The step labels (launch, wait_for, tap, type, assert_visible, screenshot) are semantic intents — the AI interprets each one and calls the appropriate MCP tools (launch_app, describe_screen, tap, type_text, screenshot, etc.) to carry them out.
Use list_scenarios to discover available scenarios and get_scenario to load them.
Tips
- - Always call
describe_screen before tapping — never guess coordinates. - Use
scroll_to "label" to find off-screen elements instead of manual swiping. - After typing, iOS autocorrect may alter text — type carefully or disable autocorrect on the iPhone.
- Use
reset_app before launch_app to ensure a fresh app state. - For keyboard shortcuts in apps, use
press_key with modifiers (e.g., press_key n [command] for new message in Mail). - INLINECODE55 with
skip_ocr: true returns only the grid screenshot, letting your vision model identify icons and images OCR can't read.
Troubleshooting
- - "iPhone Mirroring not found" → Open iPhone Mirroring.app manually, ensure your iPhone is paired
- Taps not registering → Check Karabiner DriverKit extension is approved in System Settings
- Screenshot permission denied → Grant Screen Recording permission to your terminal
- Helper not running → Run
npx iphone-mirroir-mcp setup to reinstall the helper daemon
Mirroir — 通过iPhone镜像控制iPhone
使用mirroir通过macOS iPhone镜像功能控制真实的iPhone。从终端即可完成截屏、点击、滑动、输入、启动应用、录制视频、屏幕OCR以及运行多步骤自动化场景。适用于屏幕上的任何应用,无需源代码或越狱。
何时使用
✅ 在以下情况使用此技能:
- - 用户想要与iPhone交互(点击、滑动、输入、导航)
- 在iPhone上发送iMessage、WhatsApp或任何即时通讯应用消息
- 在iPhone上添加日历事件、提醒事项或备忘录
- 测试移动应用(Expo Go、TestFlight、App Store应用)
- 截取iPhone屏幕截图
- 录制iPhone交互视频
- 读取iPhone屏幕内容(OCR)
- 自动化多步骤iPhone工作流程(登录流程、应用导航)
- 检查iPhone设置或切换网络模式
- 在iPhone上启动应用
- 用户提到在我的手机上、在我的iPhone上、在iOS上
何时不使用
❌ 在以下情况不要使用此技能:
- - 用户想从macOS的Messages.app发送iMessage → 使用imsg技能
- 用户想在macOS上管理Apple提醒事项 → 使用apple-reminders技能
- 用户想在macOS上管理Apple备忘录 → 使用apple-notes技能
- 用户想自动化macOS界面 → 使用peekaboo技能
- 用户想控制摄像头 → 使用camsnap技能
- 任务可以在macOS上完全完成,无需iPhone
- iPhone镜像未连接(先用mirroir status检查)
系统要求
- - macOS 15+(Sequoia或更高版本)
- 通过iPhone镜像连接的iPhone
- Karabiner-Elements(由mirroir安装程序自动安装)
- 已授予屏幕录制和辅助功能权限
安装设置
安装后,运行设置以配置辅助守护程序和Karabiner:
bash
一行安装(推荐)
/bin/bash -c $(curl -fsSL https://mirroir.dev/get-mirroir.sh)
或通过Homebrew安装
brew tap jfarcand/tap && brew install iphone-mirroir-mcp
或通过npx安装
npx -y iphone-mirroir-mcp install
如果提示,请批准Karabiner DriverKit扩展:系统设置 > 通用 > 登录项与扩展 — 启用Karabiner-Elements下的所有开关。
MCP服务器配置
Mirroir是一个MCP服务器。在OpenClaw MCP设置中配置:
json
{
mirroir: {
command: npx,
args: [-y, iphone-mirroir-mcp]
}
}
如果通过Homebrew安装,直接使用二进制路径:
json
{
mirroir: {
command: iphone-mirroir-mcp
}
}
核心工作流程
任何iPhone任务的典型工作流程:
- 1. 检查状态:mirroir status — 验证iPhone镜像已连接
- 查看屏幕:mirroir describe_screen — OCR屏幕以查找点击目标
- 执行操作:根据屏幕显示内容进行点击、滑动、输入、启动应用
- 验证:截取屏幕截图或再次描述屏幕以确认
可用工具(共26个)
屏幕与视觉
- - screenshot — 将iPhone屏幕捕获为PNG格式
- describescreen — OCR屏幕,返回带有精确点击坐标的文本元素以及叠加网格的截图
- getorientation — 报告竖屏/横屏状态和窗口尺寸
- status — 连接状态、窗口几何信息、设备就绪状态
- check_health — 完整诊断:镜像、辅助程序、Karabiner、屏幕捕获
输入
- - tap x y — 在坐标处点击
- doubletap x y — 两次快速点击(缩放、文本选择)
- longpress x y — 长按以显示上下文菜单(默认500ms)
- swipe fromx fromy tox toy — 在两点之间滑动
- drag fromx fromy tox toy — 慢速拖拽(图标、滑块)
- typetext text — 通过Karabiner虚拟键盘输入文本
- presskey key [modifiers] — 发送特殊按键(回车、退出、Tab、方向键),可选修饰键(Command、Shift、Option、Control)
- shake — 触发摇动手势(Ctrl+Cmd+Z)用于撤销/开发菜单
导航
- - launchapp AppName — 通过Spotlight搜索打开应用
- openurl https://... — 在Safari中打开URL
- presshome — 返回主屏幕
- pressappswitcher — 打开应用切换器
- spotlight — 打开Spotlight搜索
- scrollto label — 滚动直到通过OCR找到文本元素
- reset_app AppName — 通过应用切换器强制退出应用
录制与测量
- - startrecording — 开始录制镜像屏幕的视频
- stoprecording — 停止录制并返回.mov文件路径
- measure action until [max_seconds] — 计时屏幕切换
网络与场景
- - setnetwork mode — 通过设置切换飞行模式/Wi-Fi/蜂窝网络
- listscenarios — 列出可用的YAML自动化场景
- get_scenario name — 读取场景文件
坐标
坐标是相对于镜像窗口左上角的点。始终先使用describe_screen 通过OCR获取精确的点击坐标。网格叠加有助于定位无标签图标(返回箭头、齿轮、星形)。
示例
在iPhone上发送iMessage
- 1. launchapp Messages
- describescreen → 找到新信息按钮坐标
- tap [x] [y] 在新信息上
- typetext Alice
- describescreen → 在建议中找到Alice
- tap [x] [y] 在Alice上
- tap [x] [y] 在消息输入框上
- typetext 晚到10分钟
- presskey return
- screenshot → 确认已发送
测试登录流程
- 1. launchapp MyApp
- describescreen → 找到邮箱字段
- tap [x] [y] 在邮箱上
- typetext ${TESTEMAIL}
- tap [x] [y] 在密码上
- typetext ${TESTPASSWORD}
- tap [x] [y] 在登录上
- describe_screen → 验证欢迎出现
迟到 — 查看Waze预计到达时间并通知团队Slack
- 1. launchapp Waze
- describescreen → 读取到当前目的地的预计到达时间(如23分钟)
- presshome
- launchapp Slack
- describescreen → 找到目标频道
- tap [x] [y] 在#standup上
- tap [x] [y] 在消息输入框上
- typetext 提醒一下 — Waze显示还有23分钟,9:25前到
- press_key return
- screenshot → 确认已发送
录制Bug复现过程
- 1. startrecording
- launchapp 设置
- scrollto 通用
- tap [x] [y] 在通用上
- scrollto 关于本机
- tap [x] [y] 在关于本机上
- stop_recording → 返回.mov文件路径
场景(YAML自动化)
Mirroir支持用于多步骤自动化流程的YAML场景文件。场景描述意图而非坐标 — AI读取步骤并使用上述MCP工具执行,适应屏幕上的实际内容。
yaml
name: Expo Go登录流程
app: Expo Go
description: 使用有效凭据测试Expo Go应用的登录界面
steps:
- launch: Expo Go
- waitfor: ${APPSCREEN:-LoginDemo}
- tap: ${APP_SCREEN:-LoginDemo}
- wait_for: 邮箱
- tap: 邮箱
- type: ${TEST_EMAIL}
- tap: 密码
- type: ${TEST_PASSWORD}
- tap: 登录
- assert_visible: 欢迎
- screenshot: login_success
步骤标签(launch、wait_for、