decentral-foundation / decentral-foundation/jasonmeng.org
Update blog
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 1
- Avg merge
- 11m
- Merged PRs (30d)
- 2
Description
# Remote Mac Control From Your Phone (Nomad Setup)
Control a MacBook Pro (VS Code + multiple cloud/zsh terminals) from an iPhone over any network, no static IP or ISP access required.
**Stack:** Tailscale (network) + tmux (persistent terminals) + caffeinate (keep awake) + Blink Shell (phone client) + screencapture (screenshots via Taildrop).
---
## 1. Tailscale — private mesh network
Joins your Mac and phone on a private network with stable IPs that follow you across any WiFi or cellular. No port forwarding, works behind NAT.
### On the Mac
```bash
# Install (Homebrew)
brew install --cask tailscale
# Or download the app from https://tailscale.com/download/mac
# Launch it, sign in (Google/GitHub/etc.)
# Confirm connection and note the Mac's Tailscale IP (100.x.x.x)
tailscale ip -4
```
### On the iPhone
1. Install **Tailscale** from the App Store.
2. Sign in with the **same account**.
3. Both devices now appear in the same tailnet.
---
## 2. Enable SSH + keep-awake on the Mac
### Turn on Remote Login (SSH)
```bash
# Enable SSH server
sudo systemsetup -setremotelogin on
# Verify
sudo systemsetup -getremotelogin
```
Or: System Settings > General > Sharing > Remote Login (toggle on).
### Keep the Mac awake while unplugged
```bash
# Prevents sleep (system + display) indefinitely; Ctrl-C to stop
caffeinate -dimsu
```
Run it inside its own tmux window (below) so it persists. For a permanent setting, use the Amphetamine app instead.
---
## 3. tmux — persistent terminal sessions
tmux holds all your terminals server-side. Detach from the Mac, reattach from the phone, same live sessions.
### Install
```bash
brew install tmux
```
### Minimal config (optional but recommended)
```bash
cat > ~/.tmux.conf << 'EOF'
set -g mouse on
set -g history-limit 50000
set -g default-terminal "screen-256color"
setw -g mode-keys vi
EOF
```
### Start a named session with multiple windows
```bash
# Start (or attach to) a session called "work"
tmux new -s work
# Inside tmux:
# Ctrl-b c create a new window (one per cloud terminal / zsh)
# Ctrl-b switch to window number n
# Ctrl-b , rename window
# Ctrl-b d detach (leaves everything running)
```
Put each cloud terminal / zsh shell in its own window, and give `caffeinate` its own window too.
---
## 4. Blink Shell — connect from the phone
1. Install **Blink Shell** from the App Store.
2. Add a host:
```
host: mac
hostname:
user:
```
Use SSH keys (Blink > Settings > Keys) for passwordless login.
3. Connect and reattach:
```bash
ssh mac
tmux attach -t work
```
Blink supports **Mosh**, which survives network drops and IP changes as you move — ideal for a nomad. Install Mosh on the Mac (`brew install mosh`) and use Blink's Mosh mode instead of plain SSH.
---
## 5. Screenshots to your phone
`screencapture` grabs the Mac screen; Taildrop sends the file straight to your phone.
### One-off
```bash
screencapture -x ~/shot.png && tailscale file cp ~/shot.png phone:
```
- `-x` = silent (no shutter sound)
- `phone` = your device name as shown in `tailscale status`
On the iPhone, accept the file in the Tailscale app (Taildrop).
### One-word alias
```bash
cat >> ~/.zshrc << 'EOF'
# Screenshot -> phone via Taildrop
shot() {
local f=~/shot_$(date +%s).png
screencapture -x "$f" && tailscale file cp "$f" phone:
}
EOF
source ~/.zshrc
```
Now just type `shot` in any phone SSH session.
> Grant Terminal (and tmux) **Screen Recording** permission the first time:
> System Settings > Privacy & Security > Screen Recording.
---
## 6. Optional add-ons
**VS Code Remote Tunnels** — full editor + terminals in the phone browser, relayed through Microsoft, no networking setup:
```bash
code tunnel
# Authenticate, then open the vscode.dev/tunnel/... URL on your phone
```
**Live screen (not a still)** — remote desktop over Tailscale: Jump Desktop, or enable macOS Screen Sharing and connect a VNC client to the Mac's Tailscale IP.
**Claude Code remote** — run Claude Code on the Mac and monitor/steer the agent from the Claude mobile app while it works in your terminals.
---
## Daily flow
1. Mac on, unplugged: `tmux attach -t work` → confirm `caffeinate` running.
2. Detach (`Ctrl-b d`), close the lid stays awake (use `caffeinate -s` and keep lid open, or clamshell with power — note lid-closed on battery sleeps regardless of caffeinate).
3. From phone: `ssh mac` → `tmux attach -t work`.
4. `shot` whenever you want to see the screen.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.