简介
通过 macOS iPhone Mirroring 实现真实 iPhone 的远程操控,支持截图、点击、滑动、输入、录屏及自动化场景,无需越狱或源码访问。
原始描述
Control a real iPhone through macOS iPhone Mirroring — screenshot, tap, swipe, type, launch apps, record video, OCR, and run multi-step scenarios. Works with...
中文使用说明 来自收录源
核心功能与用法
Mirroir 是一款基于 MCP(Model Context Protocol)的 iPhone 远程控制工具,通过 macOS 15+ 内置的 iPhone Mirroring 功能,让 AI 助手能够直接操控真实 iPhone 设备。核心能力包括:
屏幕交互:screenshot 实时截图、describe_screen OCR 识别屏幕元素并返回精确点击坐标(含网格辅助定位)
输入模拟:tap/double_tap/long_press 点击操作、swipe/drag 滑动拖拽、type_text 虚拟键盘输入、press_key 发送特殊按键(支持 Command/Shift 等修饰键)
应用导航:launch_app Spotlight 启动应用、open_url 打开 Safari 链接、scroll_to 智能滚动查找元素、reset_app 强制退出应用
录制与测量:start_recording/stop_recording 录制屏幕交互视频为 .mov 文件、measure 计时屏幕过渡
场景自动化:YAML 格式的多步骤工作流,支持变量注入和断言验证,如登录流程测试、消息发送等
网络控制:set_network 切换飞行模式/Wi-Fi/蜂窝网络(需进入设置操作)
显著优势
- 零侵入架构:无需越狱、无需应用源码、无需开发者证书,任何 App Store 应用均可操控
- 真机实测:与模拟器不同,直接操作真实设备,覆盖 TestFlight、Expo Go 等测试场景
- 视觉驱动:OCR + 网格叠加的
describe_screen让 AI 能"看见"屏幕,自适应 UI 变化 - 语义化场景:YAML 场景文件描述意图而非坐标,AI 动态解析执行,维护成本低
- 无缝集成:作为 MCP Server 接入 Claude 等支持 MCP 的 AI 助手,自然语言即可驱动
潜在局限与风险
系统依赖严格:必须 macOS 15+(Sequoia)+ 物理 iPhone + iPhone Mirroring 已配对连接,Windows/Linux 用户无法使用
权限配置复杂:需安装 Karabiner-Elements 驱动、授权 DriverKit 扩展、授予终端录屏和辅助功能权限,首次 setup 门槛较高
坐标脆弱性:虽推荐 describe_screen 获取坐标,但动态内容(如键盘弹出/收起)可能导致坐标偏移,需配合 scroll_to 等智能定位
输入限制:通过 Karabiner 虚拟键盘输入,受 iOS 自动更正影响,复杂文本需多次校验;部分安全键盘(如银行 App)可能拦截虚拟输入
网络模式切换慢:set_network 需实际进入设置 App 操作,非系统 API 直接控制,执行耗时较长
适合人群
- 移动端 QA/测试工程师:自动化测试真实设备上的 App Store 应用、TestFlight 版本
- iOS 开发者:快速复现 bug、录制操作视频、验证 UI 在不同屏幕尺寸的表现
- 效率自动化用户:跨设备工作流(如在 Mac 上指挥 iPhone 发送验证码、查收短信)
- 技术支持/客服:远程指导用户操作 iPhone,通过录屏生成可视化指引
常规风险
- 隐私泄露:
describe_screenOCR 可能捕获敏感信息(短信内容、银行余额),建议仅用于测试设备 - 误操作风险:自动化场景可能在错误状态下继续执行(如网络异常时重试登录),建议关键操作前加
describe_screen验证 - 驱动稳定性:Karabiner-Elements 偶发与系统更新冲突,需关注 mirroir.dev 兼容性公告
- Apple 政策风险:依赖 iPhone Mirroring 私有协议,未来 macOS 更新可能破坏兼容性
技能正文
name: mirroir description: Control a real iPhone through macOS iPhone Mirroring — screenshot, tap, swipe, type, launch apps, record video, OCR, and run multi-step scenarios. Works with any app on screen, no source code or jailbreak required. homepage: https://mirroir.dev metadata: { "openclaw": { "emoji": "📱", "os": ["darwin"], "requires": { "bins": ["iphone-mirroir-mcp"] }, "install": [ { "id": "brew", "kind": "brew", "formula": "jfarcand/tap/iphone-mirroir-mcp", "bins": ["iphone-mirroir-mcp"], "label": "Install mirroir via Homebrew", }, { "id": "node", "kind": "node", "package": "iphone-mirroir-mcp", "bins": ["iphone-mirroir-mcp"], "label": "Install mirroir (npx)", }, ], }, }
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
imsgskill - User wants to manage Apple Reminders on macOS → use
apple-remindersskill - User wants to manage Apple Notes on macOS → use
apple-notesskill - User wants to automate macOS UI → use
peekabooskill - User wants to control a camera → use
camsnapskill - The task can be done entirely on macOS without the iPhone
- iPhone Mirroring is not connected (check with
mirroir statusfirst)
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:
# One-line install (recommended)
/bin/bash -c "$(curl -fsSL https://mirroir.dev/get-mirroir.sh)"
# Or via Homebrew
brew tap jfarcand/tap && brew install iphone-mirroir-mcp
# Or via npx
npx -y iphone-mirroir-mcp install
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:
{
"mirroir": {
"command": "npx",
"args": ["-y", "iphone-mirroir-mcp"]
}
}
Or if installed via Homebrew, use the binary path directly:
{
"mirroir": {
"command": "iphone-mirroir-mcp"
}
}
Core Workflow
The typical workflow for any iPhone task:
- 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 PNGdescribe_screen— OCR the screen, returns text elements with exact tap coordinates plus a grid-overlaid screenshotget_orientation— Report portrait/landscape and window dimensionsstatus— Connection state, window geometry, device readinesscheck_health— Full diagnostic: mirroring, helper, Karabiner, screen capture
Input
tap x y— Tap at coordinatesdouble_tap x y— Two rapid taps (zoom, text selection)long_press x y— Hold tap for context menus (default 500ms)swipe from_x from_y to_x to_y— Swipe between two pointsdrag from_x from_y to_x to_y— Slow drag for icons, sliderstype_text "text"— Type text via Karabiner virtual keyboardpress_key key [modifiers]— Send special keys (return, escape, tab, arrows) with optional modifiers (command, shift, option, control)shake— Trigger shake gesture (Ctrl+Cmd+Z) for undo/dev menus
Navigation
launch_app "AppName"— Open app via Spotlight searchopen_url "https://..."— Open URL in Safaripress_home— Go to home screenpress_app_switcher— Open app switcherspotlight— Open Spotlight searchscroll_to "label"— Scroll until a text element becomes visible via OCRreset_app "AppName"— Force-quit app via App Switcher
Recording & Measurement
start_recording— Start video recording of the mirrored screenstop_recording— Stop recording and return the .mov file pathmeasure action until [max_seconds]— Time a screen transition
Network & Scenarios
set_network mode— Toggle airplane/Wi-Fi/cellular via Settingslist_scenarios— List available YAML automation scenariosget_scenario "name"— 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
1. launch_app "Messages"
2. describe_screen → find "New Message" button coordinates
3. tap [x] [y] on "New Message"
4. type_text "Alice"
5. describe_screen → find Alice in suggestions
6. tap [x] [y] on Alice
7. tap [x] [y] on the message field
8. type_text "Running 10 min late"
9. press_key return
10. screenshot → confirm sent
Test a login flow
1. launch_app "MyApp"
2. describe_screen → find Email field
3. tap [x] [y] on Email
4. type_text "${TEST_EMAIL}"
5. tap [x] [y] on Password
6. type_text "${TEST_PASSWORD}"
7. tap [x] [y] on "Sign In"
8. describe_screen → verify "Welcome" appears
Running late — check Waze ETA and notify the team on Slack
1. launch_app "Waze"
2. describe_screen → read ETA to current destination (e.g. "23 min")
3. press_home
4. launch_app "Slack"
5. describe_screen → find target channel
6. tap [x] [y] on "#standup"
7. tap [x] [y] on message field
8. type_text "Heads up — Waze says 23 min out, be there by 9:25"
9. press_key return
10. screenshot → confirm sent
Record a bug reproduction
1. start_recording
2. launch_app "Settings"
3. scroll_to "General"
4. tap [x] [y] on "General"
5. scroll_to "About"
6. tap [x] [y] on "About"
7. stop_recording → returns path to .mov file
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.
name: Expo Go Login Flow
app: Expo Go
description: Test the login screen of an Expo Go app with valid credentials
steps:
- launch: "Expo Go"
- wait_for: "${APP_SCREEN:-LoginDemo}"
- tap: "${APP_SCREEN:-LoginDemo}"
- wait_for: "Email"
- tap: "Email"
- type: "${TEST_EMAIL}"
- tap: "Password"
- type: "${TEST_PASSWORD}"
- tap: "Sign In"
- assert_visible: "Welcome"
- screenshot: "login_success"
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_screenbefore 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_appbeforelaunch_appto ensure a fresh app state. - For keyboard shortcuts in apps, use
press_keywith modifiers (e.g.,press_key n [command]for new message in Mail). describe_screenwithskip_ocr: truereturns 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 setupto reinstall the helper daemon
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。
其他来源收录
同一技能在不同目录的原始页面: