Control your Mac from iPhone or iPad
macOS has a built-in VNC server called Screen Sharing. Turn it on, add the Mac to AnyPane, and you can see and control its desktop from an iPhone, an iPad or another Mac, with a terminal to the same Mac in the next pane.
What you need
- The Mac you want to control, a macOS user account on it with a password, and an administrator to change its Sharing settings.
- AnyPane on an iPhone or iPad with iOS/iPadOS 17, or a Mac with macOS 15.
- A network path to the Mac: the same Wi-Fi network, or a VPN such as Tailscale when you’re away.
1. Turn on Screen Sharing
- On the Mac, open System Settings → General → Sharing.
- Turn on Screen Sharing.
- Click the info button next to it and choose who may connect: all users, or only the accounts you list.
-
Note the Mac’s local hostname at the bottom of the Sharing pane,
such as
studio.local, or its IP address.
On macOS Monterey and earlier, the same settings are in System Preferences → Sharing.
2. Turn on Remote Login
Remote Login is the Mac’s SSH server. In the same Sharing pane, turn on Remote Login and choose which users may log in. With it on, the screen travels inside an encrypted SSH connection. AnyPane’s direct VNC is not encrypted, so this step is strongly recommended, even at home.
3. Add the Mac to AnyPane
-
Add an SSH connection. Address: the Mac’s hostname or IP address.
Port:
22. Username: your macOS account name. Credential: the account password, or an OpenSSH Ed25519 key whose public key is in~/.ssh/authorized_keyson the Mac. -
Connect once and verify the SHA-256 host key fingerprint. To see the
Mac’s own fingerprint, run
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pubon it. -
Add a VNC connection. Address:
127.0.0.1. Port:5900. - Under Authentication, enter the same macOS account name and password. Apple Screen Sharing needs both.
- Under Security, set SSH Tunnel to the SSH connection from step 1.
- Add the VNC connection to a workspace and open it. Add the SSH connection too if you want a terminal on the same Mac.
The VNC address is 127.0.0.1 because it is resolved on the
Mac at the other end of the SSH connection.
VNC over SSH explains how the
tunnel works.
The first time you connect to a device on your network, iOS and iPadOS ask whether AnyPane may find devices on your local network. Allow it. If you declined, turn it on in Settings → Privacy & Security → Local Network. On a Mac, the same switch is in System Settings → Privacy & Security → Local Network.
4. Use the desktop
- On iPhone and iPad, choose touch, trackpad or view-only input. View-only mode sends no pointer input, which is safe for watching a long job.
- Scale with Fit, Fill or 1:1, then zoom and pan.
- Turn text clipboard sync on or off for each direction.
- Lower the image quality on slow or cellular networks.
- On iPad and Mac, keep the Mac’s terminal and desktop side by side in one workspace. On iPhone, switch between them with tabs.
Reach your Mac when you’re away
Don’t open port 5900 or 22 on your router to
the internet. Put the Mac and your device on the same private network
with a VPN such as Tailscale or WireGuard, and use the Mac’s VPN
address as the SSH address. If the Mac sits behind a bastion server,
use a jump host.
Troubleshooting
- The connection times out
- Check that both devices are on the same network or VPN, and that AnyPane has Local Network access. A sleeping Mac doesn’t answer: turn on Wake for network access in System Settings → Energy (Energy Saver on older macOS), or in Battery → Options on a MacBook.
- SSH is refused
- Remote Login is off, or your account isn’t allowed to use it. Check the Remote Login options in the Sharing pane.
- SSH works, VNC doesn’t
-
Screen Sharing is off. On the Mac,
lsof -nP -iTCP:5900 -sTCP:LISTENshould show a listener. The VNC address must be127.0.0.1and the port5900. - VNC authentication failed
- Use the macOS account name and password, and check that the account is allowed in the Screen Sharing options.
- It disconnects when you switch apps
- iOS and iPadOS may suspend connections in the background. Return to AnyPane and connect again.
Limits
AnyPane connects over VNC, so extras of Apple’s Screen Sharing app, such as remote audio and file transfer, aren’t available. No session recording. Direct VNC is not encrypted, so use the SSH tunnel.
FAQ
- Do I need anything installed on the Mac?
- No. Screen Sharing and Remote Login are built into macOS.
- Can I control a Mac from another Mac?
- Yes. AnyPane runs on macOS 15 and later, with the same steps.
- Can I see the Mac without moving its pointer?
- Yes. Use view-only mode.
- Does this give me a terminal too?
- Yes. The SSH connection from step 3 opens a terminal on the Mac in its own pane.
Related
Get AnyPane
For iPhone, iPad and Mac.