# iOS 应用

cmux iOS 应用是你 Mac 的配套应用。将 iPhone 或 iPad 与运行 cmux 的 Mac 配对，即可从手机连接到你的终端，并可选择转发终端通知。

[Set up cmux on iPhone and iPad](https://cmux.com/zh-CN/docs/ios#setup)

iOS 应用处于测试版阶段。它通过 TestFlight 以 cmux BETA 的形式发布。

## 获取访问权限

该应用通过 TestFlight 分发。[cmux Founders Edition](https://github.com/manaflow-ai/cmux#founders-edition) 包含抢先访问权限，以及其他早期功能。

## Set up cmux on iPhone and iPad

cmux on iOS connects to cmux running on your Mac. Your shells and agents continue running on the Mac while you view and control their workspaces from your phone or tablet.

### Before you start

-   Install the latest cmux on your Mac and keep it open with at least one workspace. If the phone requests a newer Mac version, update the specific cmux app you are connecting to.
-   Install cmux on your iPhone or iPad. For the beta, accept your TestFlight invitation and install cmux BETA through TestFlight.
-   Have both devices connected to the internet and use the same cmux account. If you use teams, select the same team on both devices.

[Download cmux for Mac](https://cmux.com/zh-CN) · [Get cmux for iOS](https://cmux.com/zh-CN/ios)

### 1\. Enable pairing on your Mac

1.  Open cmux on the Mac and sign in to your cmux account.
2.  Open cmux Settings, select Mobile, and turn on Enable iOS pairing. Do this in each cmux Mac app you want to access from your phone.
3.  Keep cmux running and the Mac awake. If the Mac sleeps, shuts down, or loses its connection, the phone cannot reach its terminals.

Pairing is off by default. While it is off, that Mac stays hidden from iOS. Signing in alone does not enable pairing.

### 2\. Sign in and connect from iOS

1.  Open cmux on your iPhone or iPad and sign in with the same cmux account as the Mac. Check the email on both devices if you have more than one account.
2.  Follow the introduction. Enable Notifications when asked, or choose Not Now and enable them later. On the pairing page, confirm that you enabled iOS pairing on your Mac.
3.  Choose Auto-Connect and tap Check for My Mac. This discovers compatible Macs signed in to your account. Auto-Connect does not require you to install Tailscale.
4.  When the Mac is connected, tap Open Workspaces. Choose a workspace, then a terminal to view output and send input. Use All Computers at the top to change the selected Mac.

Allow Local Network access if iOS asks. If you previously denied it, open the iPhone or iPad Settings app, find cmux, and enable Local Network. Then return to cmux and tap Retry.

### Optional: connect with Tailscale Only

1.  Install Tailscale on the Mac and iPhone or iPad, sign both into the same Tailscale network, and confirm Tailscale is connected on both.
2.  Keep Enable iOS pairing on in cmux Settings > Mobile. On iOS, select Tailscale Only in the connection options, then choose Scan Pairing Code.
3.  Open Mobile Connect in cmux on the Mac and scan its pairing code with the phone. Allow camera access when requested and follow the pairing prompts.
4.  Keep Tailscale connected on both devices when using this mode, including when the phone switches from Wi-Fi to cellular. Your Tailscale access rules must allow the phone to reach the Mac.

### 3\. Enable agent notifications

1.  Tap Enable Notifications during the introduction and allow notifications in the iOS prompt. If you skipped or denied it, open iOS Settings > Notifications > cmux and enable Allow Notifications.
2.  Check notification settings in cmux on both devices and enable forwarding where offered. Keep the Mac running and connected so it can send new agent alerts.
3.  Open a workspace with a configured coding agent and trigger an alert. Check the Notifications tab in cmux, then check delivery to your phone. Focus modes and Scheduled Summary can delay or silence alerts.

[Configure terminal and agent notifications](https://cmux.com/zh-CN/docs/notifications)

### 4\. Verify your connection

1.  Open a terminal from the phone and run a harmless command such as pwd. Confirm the output appears on the phone and in the same Mac workspace.
2.  Switch to another workspace, then return. If you plan to connect away from home, test on cellular before leaving the Mac.
3.  Keep the Mac plugged in and awake for remote access. A keep-awake option may be offered during setup; use it if you want the Mac to remain reachable.

### If no workspaces appear

After correcting a setup issue, return to Workspaces and tap Retry. Retry reconnects to a saved Mac or refreshes the workspace list and account-backed connection information.

### The Mac is missing

Check Enable iOS pairing in Settings > Mobile on the exact Mac app you opened. Confirm the same cmux account and team on both devices, and keep that Mac app running. Use the Computers button to inspect available Macs and check whether you hid the computer.

### cmux asks for a newer Mac app

Update cmux on the Mac, then quit and reopen that app. If you run several cmux versions, confirm the phone is selecting the updated one. Follow the minimum version shown by the iOS app.

### The Mac appears but will not connect

Wake the Mac and check internet access on both devices. Allow Local Network access on iOS if requested. For Tailscale Only, check that both Tailscale apps are connected to the same network and that access rules permit the connection. Then tap Retry.

### The connection works but the list is empty

Create or open a workspace in cmux on the Mac. On the phone, choose All Computers and clear workspace search or filters. Pull down to refresh the list, or tap Retry in the empty state.

### Still need help?

Include your cmux versions on Mac and iOS, your connection mode, the exact error, and whether the Mac appears under Computers. Never include passwords or pairing codes.

[Contact cmux support](https://cmux.com/zh-CN/support)

## 前提条件

开始之前，你需要：

-   一台运行 cmux 并已登录的 Mac。
-   一台已从 TestFlight 安装 cmux BETA 应用的 iPhone 或 iPad。
-   从手机到 Mac 的网络路径（参见下方的自带网络）。

## 自带网络

cmux 不提供开箱即用的网络。终端流在你的手机和 Mac 之间直接传输，因此你的手机必须能够在网络上访问到你的 Mac。最简单的方式是使用私有覆盖网络。

### Tailscale（推荐）

在你的 Mac 和手机上都安装 [Tailscale](https://tailscale.com)，并登录到同一个 tailnet。这样你的手机就可以从任何地方通过 Mac 的 tailnet 地址访问它，无需端口转发。

### WireGuard

如果你已经在运行 [WireGuard](https://www.wireguard.com)，将你的 Mac 和手机置于同一网络，并使用 Mac 的 WireGuard 地址。

无论你选择哪种方式，连接都归你所有。cmux 不会在你的设备之间代理或中继终端流量。

## 配对与连接

1.  在 Mac 上，打开 cmux 中的 Mobile Connect 窗口。
2.  在你的手机上，打开 cmux BETA 应用并确认 Mobile Connect 中显示的配对。
3.  配对完成后，你的工作区和终端会通过你的网络出现在手机上。

配对是按设备进行的。新设备或重新安装的应用需要再次配对。

## 通知

你可以选择将终端通知转发到手机，这样需要关注的面板就会推送到你的设备。开启转发后，通知文本（标题和正文，取自终端输出）会通过 cmux 服务器发送到 Apple 的推送服务以进行投递。在通知设置中开启 Hide content，即可改为发送通用消息，并将终端文本保留在你的设备上。请参阅 [通知](https://cmux.com/zh-CN/docs/notifications) 了解 cmux 如何触发它们。

## 存储哪些数据

cmux 的设计让你的终端只在你的设备之间流转。在 cmux 服务器上，我们只存储登录你的账户和连接你的设备所需的内容：

-   你登录时的账户（邮箱），用于在各设备间识别你。
-   你设备的推送令牌，用于投递转发的终端通知。
-   配对和设备元数据，用于将你的手机连接到你的 Mac。

你的交互式终端会话、其内容和击键，通过你自己的网络在手机和 Mac 之间直接传输，不会经由 cmux 服务器中继或存储在其上。唯一的例外是转发的通知文本，它会经过 cmux 和 Apple 的推送服务到达你的手机，除非你启用 Hide content（参见上方的通知）。

## 企业与自托管

如需自托管或气隙隔离部署，请联系 [founders@cmux.com](mailto:founders@cmux.com?subject=cmux%20enterprise)。

Canonical: https://cmux.com/zh-CN/docs/ios

Documentation index: https://cmux.com/llms.txt
