---
title: "Android 和 iOS（WireGuard 应用） | Wantastic Docs"
description: "2 分钟内连接 Android 或 iOS 手机或平板：在控制台中添加设备，然后用官方 WireGuard 应用扫描其二维码。"
url: "https://wantastic.app/zh/docs/install-mobile-wireguard"
category: "Install wantasticd"
reading_time: "3 分钟"
---

# Android 和 iOS（WireGuard 应用）

2 分钟内连接 Android 或 iOS 手机或平板：在控制台中添加设备，然后用官方 WireGuard 应用扫描其二维码。

> **Outcome:** 手机通过 WireGuard 隧道连接到你的覆盖网络，可以通过覆盖网络 IP 访问你的设备，隧道开启时在控制台中显示为 Online。

## Before you start

- 来自 Google Play 或 App Store 的免费 WireGuard 应用（开发者为 WireGuard Development Team）。
- 在电脑屏幕上打开控制台，用于显示二维码。
- 套餐中还有一个空闲的设备名额。

## 快速设置（2 分钟）

手机不运行 wantasticd，而是使用标准的 WireGuard 应用，并扫描控制台中的二维码。

1. 在控制台中打开 Devices，点击 Add Device。输入名称（例如 Alex iPhone），保持 1. Standard，然后点击 Add Device。
2. 在 New Connection Setup 中选择 WireGuard，再选择 QR Code。二维码随即显示。
3. 在手机上打开 WireGuard 并点击 +。点击 Scan from QR code（Android）或 Create from QR code（iOS）。
4. 扫描二维码，输入隧道名称，并在手机询问时允许 VPN。
5. 开启隧道。手机在 Devices 中显示为 Online。

*Console: Add New Device：命名并保持 1. Standard。*

1. 输入 Device Name
2. 保持 1. Standard
3. 点击 Add Device

*Console: New Connection Setup：选择 WireGuard，再选择 QR Code。*

1. 选择 WireGuard
2. 选择 QR Code

*Console: Device Configuration → QR Code 选项卡："Scan with WireGuard mobile app"。*

1. QR Code 选项卡
2. 用手机扫描此码
3. 或使用 WireGuard 选项卡下载 .conf 文件

*Console: WireGuard 应用：通过二维码添加隧道并开启。*

1. 点击 +
2. Scan from QR code
3. 开启隧道

> **Warning:** 二维码中包含手机的私钥。不要分享它的截图。如果已泄露，请在控制台中删除该设备并重新创建一个。

> **Tip:** 已经有这台设备？打开其设备行 → Show Config → QR Code 选项卡。

## 检查是否正常工作

1. 在 WireGuard 应用中点击该隧道。Latest handshake 显示为几秒钟前。
2. 在控制台 Devices 窗口中，手机显示为 Online。
3. 在手机上打开某台设备的覆盖网络 IP（例如 http://10.200.0.3）。

*Console: Devices 窗口：新设备以其名称出现，并在几秒钟内变为 Online。*

1. 按名称搜索
2. 状态显示 Online
3. 覆盖网络 IP 与 wantasticd status 一致
4. Last seen 持续更新

## 其他设置方式

- iOS 按需连接：隧道可以在使用蜂窝网络或不受信任的 Wi-Fi 时自动开启（在隧道设置中配置）。
- Android 始终开启的 VPN：Settings → Network → VPN → WireGuard → Always-on。
- 默认配置只让覆盖网络流量经过隧道。全隧道（0.0.0.0/0）会让所有流量经过隧道。

### 通过文件

1. 在控制台中打开 WireGuard 选项卡，点击 Download（wantastic-overlay.conf）。
2. 通过私密方式将文件发送到手机（不要用公开聊天）。
3. 在 WireGuard 中点击 + → Import from file or archive，然后选择该文件。

## Verify the result

- WireGuard 应用显示最近的 Latest handshake。
- 手机在 Devices 中显示为 Online。
- 你可以从手机访问另一台设备的覆盖网络 IP。

## Common issues

### 隧道已开启，但没有握手。

- **Where:** WireGuard 应用
- **Likely cause:** 手机所在网络阻止了 UDP 51820（某些访客或公司 Wi-Fi），或该设备已在控制台中被删除。
- **Fix:** 尝试用移动数据代替 Wi-Fi。如果移动数据下可以连接，说明 Wi-Fi 阻止了 UDP。如果始终无法连接，请检查该设备是否仍在 Devices 中，并重新扫描其二维码。

### 两部手机不断把对方挤下线。

- **Where:** WireGuard 应用 / 控制台
- **Likely cause:** 两部手机扫描了同一个二维码，因此共用同一个密钥。
- **Fix:** 为每部手机单独创建一台设备（Add Device）。

### 二维码无法扫描。

- **Where:** WireGuard 应用
- **Likely cause:** 屏幕反光、二维码太小，或摄像头无法对焦。
- **Fix:** 放大浏览器使二维码填满屏幕，或改为导入 .conf 文件。

### Add Device 失败。

```
You have reached the maximum number of devices for your plan.
```

- **Where:** 控制台
- **Likely cause:** 已达到套餐的设备数量上限。
- **Fix:** 删除一台不再使用的设备，或升级套餐。

### 隧道开启后，手机无法上网。

- **Where:** 手机
- **Likely cause:** 配置为全隧道（0.0.0.0/0），且没有出口节点处理互联网流量。
- **Fix:** 使用默认配置，或设置出口节点（参见 wantasticd CLI 参考）。

## Continue with

- [Choose your install method](https://wantastic.app/zh/docs/install-overview): Find your device in one table and copy one command. Most devices install in 2 minutes: install, scan a QR code, click Claim Device.
- [Device onboarding](https://wantastic.app/zh/docs/device-onboarding): The easiest way to connect each kind of device: claim for Linux, Mac and OpenWrt, a script for MikroTik, a QR code for phones, and tokens for automation.
- [Topology, group links and exit nodes](https://wantastic.app/zh/docs/topology-and-access): See the network map, let devices reach each other with group links, and send a device's internet through another.
- [WebProxy for device web UIs](https://wantastic.app/zh/docs/webproxy): Open a router, NAS or camera web page in the console. No port forward needed.
- [Troubleshooting: start here](https://wantastic.app/zh/docs/troubleshooting): Fix most problems in 3 steps. If that does not work, find your exact error in the table and open the matching guide.
