@XAMTO_AI: 手边有闲置的iPhone或iPad?不少人应该都有。放着吃灰觉得可惜,想拿来当副屏又发现市面上的方案多少都有点门槛。 OpenDisplay 这个开源项目把这事儿简单化了。免费、开源、不需要账号、不需要额外硬件,就能把闲置的iOS设备变成…
摘要
OpenDisplay 是一个开源项目,可以将闲置的 iPhone 或 iPad 变成 Mac 的第二块屏幕,支持 USB 和 WiFi 连接,免费且无需额外硬件。
查看缓存全文
缓存时间: 2026/07/20 19:32
手边有闲置的iPhone或iPad?不少人应该都有。放着吃灰觉得可惜,想拿来当副屏又发现市面上的方案多少都有点门槛。
OpenDisplay 这个开源项目把这事儿简单化了。免费、开源、不需要账号、不需要额外硬件,就能把闲置的iOS设备变成Mac的第二块屏幕。目前项目已经有1600+ Star。
它实现的是真实扩展屏,macOS会把设备识别成一块独立显示器,可以在系统设置里调整排列,窗口也能直接拖过去。
连接方式有两种:USB和WiFi。USB走的是macOS自带的usbmuxd,延迟更低;WiFi通过Bonjour自动发现设备。
触控输入也支持。在iPhone或iPad上点按、拖拽、双指滚动都能用,用起来更像一个带触控功能的小副屏。横屏竖屏也能跟着设备旋转自动切换,拿iPhone竖着放当一块信息屏还挺合适。
:https://github.com/peetzweg/opendisplay…
peetzweg/opendisplay
Source: https://github.com/peetzweg/opendisplay
OpenDisplay
Turn your spare Apple devices into second monitors for your Mac — free, open source, no subscription.
iPhone and iPad today, spare MacBooks on the roadmap. A self-hosted alternative to Apple Sidecar, Duet Display, and Luna Display: true extended display (not just mirroring), Retina-sharp, over USB or WiFi, with touch and scroll input.
Website · Quick start · How it works · FAQ · Contributing
Why OpenDisplay exists
Turning an iPhone or iPad into an external display for a Mac is a solved problem — but every existing option has a catch:
- Apple Sidecar is free but requires both devices on the same Apple ID, doesn’t support iPhones at all, and only works on supported hardware pairs.
- Duet Display moved to a subscription.
- Luna Display requires a hardware dongle.
OpenDisplay is the missing option: a free, open-source, no-account, no-dongle way to use the iOS device you already own as a true second display. If you were about to write your own — don’t! Contribute here instead; the hard parts (virtual display creation, low-latency H.264 pipeline, USB transport, input injection) are already working.
Features
- 🖥️ True display extension — macOS treats the device as a real second monitor (drag windows to it, arrange it in System Settings), not a mirror. Mirroring is also available as a mode.
- 🔌 USB-wired for lowest latency — streams over the Lightning/USB-C
cable via macOS’s built-in
usbmuxd; plug in and go, no network, no WiFi jitter, no helper tools. - 📶 WiFi with zero config — the iPhone advertises itself via Bonjour; pick it from a dropdown on the Mac.
- 🔍 Retina / HiDPI — the virtual display matches the device panel pixel-for-pixel (@2x), so text is sharp.
- 👆 Touch input built in — your iPhone becomes a touchscreen for macOS: tap to click, drag to drag, and two-finger scroll that feels like a trackpad. (Apple Pencil support is on the roadmap.)
- 🔄 Portrait or landscape — rotate the device and the virtual display rebuilds itself as a vertical monitor at native resolution.
- ⚡ Low-latency pipeline — hardware H.264 encode (VideoToolbox,
real-time mode, no B-frames), TCP_NODELAY, frame-drop backpressure with
keyframe recovery, decode-and-render via
AVSampleBufferDisplayLayer. - 🔒 Self-hosted & private — your screen never touches anyone’s server. Two small apps, one TCP connection, that’s it.
How it works
MAC (sender) iPHONE / iPAD (receiver)
CGVirtualDisplay ← macOS believes a monitor is attached
→ ScreenCaptureKit (capture the virtual display)
→ VideoToolbox H.264 (hardware, real-time)
→ TCP [4-byte length][Annex B frame] ═══════→ NWListener :9000
→ AVSampleBufferDisplayLayer
← JSON control messages (hello, touch, scroll) ═══
→ CGEvent injection (click / drag / scroll)
The phone listens and the Mac connects — that ordering is what makes the
exact same code work over USB (via the usbmuxd daemon built into every
macOS install) and WiFi. The phone
announces its native panel size; the Mac creates a CGVirtualDisplay at
exactly half that in points (@2x HiDPI) and streams the pixels back.
CGVirtualDisplay is a private CoreGraphics API (the same one used by
BetterDisplay and DeskPad) — which is precisely why this project can’t ship
on the App Store and lives on GitHub instead.
Install
You need two apps: a Mac app (captures and sends) and an iOS app (receives and displays).
Prebuilt downloads (Mac)
Grab OpenDisplay.dmg from the
latest release.
The app is signed with a Developer ID certificate and notarized by Apple, so it
opens with a plain double-click on macOS 14+ — no Gatekeeper warning. Open the
.dmg and drag the app to Applications.
iPhone app
- TestFlight (recommended): join the public beta at testflight.apple.com/join/3NYaY11c.
- Build from source: open the project in Xcode, select your free Apple ID under Signing, hit Run. Takes ~2 minutes.
Quick start (from source)
Prerequisites
brew install xcodegen # project generation
Xcode 15+ and a free or paid Apple developer account (to sideload the iOS app onto your device).
Build
git clone https://github.com/peetzweg/opendisplay.git
cd opendisplay
echo "DEVELOPMENT_TEAM=YOURTEAMID" > .env # your Apple team ID, for signing
./generate.sh # runs xcodegen with your .env
xcodebuild -project OpenSidecar.xcodeproj -scheme OpenSidecarMac \
-configuration Debug -derivedDataPath build build
xcodebuild -project OpenSidecar.xcodeproj -scheme OpenSidecariOS \
-configuration Debug -destination 'generic/platform=iOS' \
-derivedDataPath build -allowProvisioningUpdates build
(Or open OpenSidecar.xcodeproj in Xcode and hit Run on each target. Your
team ID is shown at developer.apple.com/account
under Membership, or just pick your team in Xcode’s Signing pane.)
Run (USB — recommended)
- Install + open OpenDisplay on the iPhone (it listens on port 9000).
- On the Mac, run
./run.sh(or just open the app) — it talks to macOS’s built-inusbmuxddirectly and auto-connects over the cable. No tunnel tools needed. - Grant Screen Recording (for capture) and Accessibility (for touch) when macOS asks — one time each.
- Drag a window onto your new display. Done.
Run (WiFi)
Open the iPhone app, then pick “iPhone (WiFi)” from the Connection menu in the Mac app. Discovery is automatic via Bonjour. USB has lower latency; WiFi has no cable.
Permissions checklist
macOS and iOS gate several things this app needs — most prompt on first use, but some fail silently if denied or missed. The Mac app shows a live permission status panel; the iPhone app has a settings screen (shake the phone, or tap Settings & Help when idle).
| Where | Permission | Needed for | If missing |
|---|---|---|---|
| Mac | Screen Recording | capturing the display | black screen on the phone |
| Mac | Accessibility | touch/scroll input | taps do nothing |
| Mac | Local Network | WiFi discovery | no device in the Connection menu |
| iPhone | Local Network | WiFi discovery | Mac can’t find the phone |
All live under Privacy & Security in System Settings (Mac) / Settings (iPhone). The Local Network ones are only needed for WiFi mode — USB works without them. If the prompt never appeared, toggle the entry manually or force-quit and reopen the app.
FAQ
Why do I see the purple screen-recording indicator in the menu bar? That’s a macOS privacy indicator shown for any app that captures the screen — Duet, Luna, OBS, and Zoom trigger it too. Apple Sidecar doesn’t, only because it’s implemented inside the OS rather than on public capture APIs. It cannot (and shouldn’t) be hidden by an app; it’s how macOS tells you a capture is running.
The Mac app doesn’t show my iPhone in the Connection menu (WiFi). Both sides need Local Network permission, and both fail silently without it: check Privacy & Security → Local Network on the Mac and on the iPhone, make sure both are on the same WiFi network, and keep the iPhone app open in the foreground. USB mode is unaffected.
Does it support iPad? The receiver app is universal (iPhone + iPad); iPad is the same codebase. iPad-specific polish (Pencil, pressure) is on the roadmap.
Why H.264 and not HEVC/AV1? Hardware H.264 encode/decode is universally fast and the latency is excellent. HEVC is a planned option for better quality-per-bit.
Is my screen content sent anywhere? No. One direct TCP connection between your Mac and your device, over your cable or your LAN. No servers, no accounts, no analytics. Full details — including what the apps store locally and the current WiFi-encryption caveat — on the privacy page.
What’s the license? Can I fork it or use it commercially? GPL-3.0. Use, study, and adapt it freely — commercially too. If you distribute a modified version it must stay open source under the same license with the original attribution intact, so improvements flow back instead of into closed forks. (Releases up to v0.4.x were MIT-licensed and remain available under those terms.)
Will it break on a macOS update? Possibly — CGVirtualDisplay is
private API. The same risk applies to every virtual-display product.
The capture/streaming pipeline itself uses only public APIs.
Audio? Out of scope for now.
Comparison
| OpenDisplay | Apple Sidecar | Duet Display | Luna Display | |
|---|---|---|---|---|
| Price | Free, open source | Free | Subscription | $$$ + dongle |
| iPhone as display | ✅ | ❌ (iPad only) | ✅ | ✅ |
| Different Apple IDs | ✅ | ❌ | ✅ | ✅ |
| Wired (USB) | ✅ | ✅ | ✅ | ❌ |
| True extension | ✅ | ✅ | ✅ | ✅ |
| Touch input | ✅ | ✅ | ✅ | ✅ |
| Self-hosted / auditable | ✅ | — | ❌ | ❌ |
Roadmap
Tracked as roadmap issues — pick one up if you’d like to contribute!
Connectivity & distribution
- #16 Encrypted WiFi transport with pairing code
- App Store release of the iOS app + notarized Mac downloads
Input
- #4 Apple Pencil with pressure and tilt
- #5 Right-click and multi-touch gestures
- #6 Hardware keyboard passthrough
- #7 On-screen modifier key sidebar
Display & media
- #9 Resolution & quality settings
- #10 HEVC encoding
- #12 Audio forwarding
- #17 macOS receiver — use another Mac as a display
Experience
Exploratory
Done: prebuilt releases, built-in USB connectivity (no helper tools), WiFi via Bonjour, portrait mode, touch + two-finger scroll, performance overlay, iPad support, multiple devices at once (#8 — every connected device becomes its own extended display).
Auto-update (macOS app)
The macOS app updates itself with Sparkle — an open-source framework, not a hosted service. Update checks hit only our own infrastructure:
- The app reads an appcast feed hosted on the landing-page site:
https://opendisplay.app/appcast.xml(SUFeedURLinproject.yml). - The release workflow (
.github/workflows/release.yml,build-macjob) runs Sparkle’sgenerate_appcastagainst the notarizedOpenDisplay.dmg, signs it with the EdDSA key, commits the result topublic/appcast.xml, and dispatches the Pages deploy — so the published feed points download links at the GitHub Release assets. - Sparkle verifies both the EdDSA signature and Apple’s notarization before
installing. The app checks automatically in the background
(
SUEnableAutomaticChecks) and offers a manual “Check for Updates…” button next to Quit in the menu-bar window.
Maintainer prerequisites (before auto-update goes live)
Auto-update is scaffolded but inert until the signing keys are in place. The private signing key is never committed — it lives only as a CI secret. To switch it on:
- Generate the key pair. Run Sparkle’s
generate_keysonce (it ships in the Sparkle SPM artifact bundle and in the release tarball atbin/generate_keys). It prints a public key and stores the private key in your login keychain. - Public key → paste it into
SUPublicEDKeyinproject.yml(replace theREPLACE_WITH_SUPUBLICEDKEY_FROM_generate_keysplaceholder), then re-runxcodegen generateand commit. - Private key → add it as the
SPARKLE_PRIVATE_KEYGitHub Actions secret (export it withgenerate_keys -x private_key.pemif needed). The appcast step inrelease.ymlno-ops gracefully while this secret is absent, so releases keep working until you’re ready. - The first appcast publishes on the next release after both keys are
set. Confirm
https://opendisplay.app/appcast.xmlresolves, then test the full update flow on a real signed/notarized build (check → download → verify → relaunch) — this can’t be validated in CI.
Contributing
Issues and PRs are very welcome — especially for the roadmap items above.
The codebase is intentionally small: ~4 Swift files per platform, with
Sparkle (SPM) as the macOS app’s only
runtime dependency, for auto-update. The How it works
section above is the architecture doc; see Mac/CGVirtualDisplayPrivate.h
for the private API surface.
Releases are automated with
release-please: use
Conventional Commits (feat:,
fix:, docs:, …) and a release PR with a generated changelog appears
automatically — merging it tags the release and attaches prebuilt
artifacts.
License
GPL-3.0 — Copyright (c) 2026 Philip Poloczek.
Free to use, study, and adapt. If you distribute a modified version it must remain open source under the same license, with the original attribution intact — improvements flow back to everyone instead of into closed forks. (Versions up to v0.4.x were MIT-licensed; those releases remain available under MIT.)
Keywords: iPhone second monitor Mac, iPad external display, free Sidecar alternative, Duet Display alternative, open source screen extension macOS, use iPhone as extra screen, virtual display Mac, USB second display.
相似文章
@neuronxwhite: 吃灰的旧 iPad 别卖!一个人写了 696 次提交,把它变成了你 Mac 的"第二台笔记本":免费、开源、不用注册账号。 Sill 今天冲上 Hacker News:把 Mac 上任意一个窗口(或整个桌面)实时投到 iPhone / i…
开源免费工具 Sill 冲上 Hacker News,可把 Mac 上任意窗口或整个桌面实时投射到 iPhone/iPad 并支持触控、Apple Pencil、键盘和触控板操作,全程无需服务器和账号,连接走 TLS 加密。该工具由一个人开发(696 次提交),支持同 Wi-Fi、USB 直连、无线直连或 Tailscale VPN 远程访问,可与旧 iPad 搭配实现随航(Sidecar)式的第二屏体验。
peetzweg/opendisplay
OpenDisplay 是一款免费的开源工具,可以将闲置的 Apple 设备(如 iPhone、iPad 和 Mac)转换为 Mac 的第二显示器,提供真正的显示扩展功能,支持 USB/WiFi 连接、触摸输入和 Retina 显示。
iphone-use
iphone-use 开源工具让 AI 智能体操控真实 iPhone 屏幕(tap/type/scroll via WebDriverAgent),并提供 MCP server、HTTP API 与浏览器远程控制,即使是无 API 的应用也能被自动化。
Mac 上的任意窗口,搬进你的 iPhone 和 iPad
Sill 是一款开源工具,可将 Mac 上的任意窗口或整个桌面以 HEVC 视频串流到 iPhone/iPad,并支持触控、触控板、键盘和 Apple Pencil 反向操作,连接无需账号或中间服务器。
@jinglian: 卧槽,Codex 可以使用你的 iPhone! 介绍一下:phone-harness > 像人类一样自动化任何 iOS 应用 > 原生 iPhone 控制 → 无需 API,无需越狱 > 连接一次,随时控制 只需一个提示即可设置。 立即开…
介绍 phone-harness,一个开源工具,通过 macOS 的 iPhone Mirroring 让 LLM(如 Codex)像人类一样自动化任意 iOS 应用,无需 API 或越狱,利用屏幕截图、Vision OCR 和 HID 事件实现视觉与操作。