A simple CLI tool to connect/disconnect your iPad as a Sidecar display from the command line — no UI scripting or mouse clicks needed.
Originally created by Jovany Ocasio. Based on SidecarLauncher.
Uses Apple's private SidecarCore framework to programmatically manage Sidecar sessions.
swiftc main.swift -o SidecarLauncher# List available devices
./SidecarLauncher devices
# Connect to a device
./SidecarLauncher connect "My iPad"
# Connect via USB (experimental)
./SidecarLauncher connect "My iPad" -wired
# Disconnect
./SidecarLauncher disconnect "My iPad"| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Invalid input |
| 2 | No reachable Sidecar devices detected |
| 3 | Named device not found |
| 4 | SidecarCore error |
- Requires macOS with Sidecar support
- Both devices must be signed into the same Apple ID
- Uses private Apple frameworks — may break on future macOS updates
MIT