# 远程设备（iOS/Android）无法连接到 Proxyman？

> 设置 Wi-Fi 代理后，iPhone 或 Android 无法上网，或无法打开 proxy.man/ssl？请检查 IP、端口、VPN 和防火墙，以连接 Proxyman 进行抓包。

## **1.** 问题 {#1-problems}

* ❌ 我在 Wi-Fi 设置中修改代理后，iOS 或 Android 设备无法访问互联网。
* ❌ 无法从 **http://cert.proxyman.io** 或 **http://proxy.man/ssl** 下载证书

> **备注:** 对于 Android，请参阅 [Android 设备和 Android 模拟器](https://proxyman.com/docs/zh-cn/troubleshooting/my-ios-devices-couldnt-connect-to-proxyman-via-proxy#android-devices-and-android-emulators)部分。

## 2. 解决方案：iOS 设备 {#2-solution-ios-devices}

请仔细检查以下步骤：

### 0. iOS 16 真机和模拟器的问题 {#0-issue-with-ios-16-physical-devices--simulator}

有用户反馈，即使已设置 HTTP 代理，**Proxyman** 和 **Charles Proxy** 仍无法抓取 iOS 16 设备或模拟器的任何流量。

这是 iOS 本身的 Bug。如果你在 iOS 17、iOS 18 或 iOS 26 上遇到相同问题，请使用相同的解决方法。

解决方法：

#### iOS 真机 {#ios-physical-devices}

* 忽略该 Wi-Fi 网络，重新连接，然后再次设置 HTTP 代理。
* 使用 [Atlantis 框架](https://github.com/ProxymanApp/atlantis)抓取流量。

#### iOS 模拟器 {#ios-simulator}

* 请参阅 [iOS 模拟器设置指南](https://proxyman.com/docs/zh-cn/debug-devices/ios-simulator)。
* 使用 [Atlantis 框架](https://github.com/ProxymanApp/atlantis)抓取流量。

- [iOS 16 和 iOS 17 相关问题](https://proxyman.com/docs/zh-cn/troubleshooting/ios-16-devices-issues)

### 1. 确保 Mac 和 iOS/Android 设备位于同一网络 {#1-make-sure-your-mac-device-and-iosandroid-devices-are-on-the-same-network}

如果它们处于不同网络，就无法互相连接。

### 2. 确保服务器 IP 和端口与 Proxyman 一致 {#2-make-sure-the-server-ip-and-port-match-proxyman}

![iOS 配置代理界面，设为手动，服务器为 192.168.0.101，端口为 9090](https://proxyman.com/docs/assets/IMG_4110.png)

_iPhone 上的代理设置_

![Proxyman iOS 设置指南，包含 Wi-Fi 代理服务器 192.168.64.4、端口 9090 以及证书安装步骤](https://proxyman.com/docs/assets/proxyman-ios-setup-guide.jpg)

_iOS 设置指南中的服务器 IP 和端口_

### 3. 在 macOS 和 iOS/Android 设备上关闭所有 VPN 应用 {#3-turn-off-all-vpn-apps-on-macos-and-iosandroid-devices}

默认情况下，VPN 应用会**强制**所有流量经过 VPN 服务器，而不是 Proxyman 代理服务器（端口 9090）。因此，Proxyman 中不会出现任何请求。

关闭所有 VPN 应用即可解决此问题：

* **iOS** 设备：打开 Settings -> General -> VPN & Device Management -> VPN，并确保 VPN 状态为 **Not Connected**。
* **Android** 设备：在 Settings 应用中找到 VPN 设置，并将其关闭。
* **macOS**：退出所有 VPN 应用。

如果无法关闭 VPN，请参阅 [Proxyman 无法与 VPN 应用配合使用](https://proxyman.com/docs/zh-cn/troubleshooting/proxyman-does-not-work-with-vpn-apps)。

### 4. 防火墙设置（macOS） {#4-firewall-settings-macos}

macOS 防火墙可能会阻止发往你的 Mac 的入站连接，此时远程设备将无法连接到 Proxyman。

在 **macOS** 上，打开 **System Settings -> Network -> Firewall -> Options…**

**请确认：**

* Block all incoming connections 设置为 **OFF**
* Proxyman 应用设置为 **Allow incoming connections**
* 如果列表中没有 Proxyman，请点击 **+** 按钮将其添加进去
* Automatically allow built-in software to receive incoming connections 设置为 **ON**
* Automatically allow downloaded signed software to receive incoming connections 设置为 **ON**

### 5. 防火墙设置（Windows 10/11） {#5-firewall-settings-windows-1011}

Windows 10/11 可能会阻止 Proxyman，导致 iPhone 和 Android 设备无法连接到该应用。请按以下步骤解决：

1. 搜索并打开 “Windows Defender Firewall” 应用，然后点击左侧面板中的 “Advanced settings”。
2. 选择 “Inbound Rules”。
3. 找到 proxyman.exe，双击打开其设置。
4. 在 “General” 标签页中选择 “Allow the connection”。
5. 点击 “OK”。

![Windows Defender 防火墙中 proxyman.exe 的入站规则，设为允许连接](https://proxyman.com/docs/assets/CleanShot%202023-01-05%20at%2009.26.50%402x.png)

_在 Windows 防火墙中允许 Proxyman_

### 6. 如果你处于公司网络中，请让安全团队开放 Proxyman 的 9090 端口 {#6-if-youre-on-a-company-network-ask-the-security-team-to-open-proxymans-port-9090}

部分公司默认会屏蔽某些端口，这会导致 iOS 设备无法通过 9090 端口访问 Proxyman。

### 7. 使用 Safari 的隐私浏览标签页打开 http://cert.proxyman.io 或 http://proxy.man/ssl {#7-use-a-private-tab-in-safari-to-open-httpcertproxymanio-or-httpproxymanssl}

### 8. 仍然无法连接 {#8-im-still-unable-to-connect}

如果你已按照上述所有步骤操作，并且配置正确，但仍然无法使用：

请尝试**关闭再打开 Wi-Fi、忽略 Wi-Fi 网络（iOS）**，然后**重启电脑**。

### 9. 仍然无法使用？（仅限 iOS 应用） {#9-still-doesnt-work-ios-app-only}

在 iOS 设备上手动设置 HTTP 代理，并安装、信任 Proxyman 证书，确实很麻烦，我们理解这一点。不妨试试 Atlantis，这是一个 iOS 框架，可以替你自动完成这些操作。

- [iOS 上的 Atlantis](https://proxyman.com/docs/zh-cn/atlantis/atlantis-for-ios)

## Android 设备和 Android 模拟器 {#android-devices-and-android-emulators}

### 1. 在 Wi-Fi 设置中配置 HTTP 代理后，无法打开 http://proxy.man/ssl {#1-after-setting-the-http-proxy-in-the-wi-fi-settings-i-cant-open-httpproxymanssl}

* [请按照上述排查步骤操作](https://proxyman.com/docs/zh-cn/troubleshooting/my-ios-devices-couldnt-connect-to-proxyman-via-proxy#1-make-sure-your-mac-device-and-iosandroid-devices-are-on-the-same-network) ☝️ 
* 仔细检查模拟器中的 Wi-Fi 连接，状态必须显示为 Connected（而非 Limited Connection 或 No Internet）。

如果没有显示，请**忽略该网络**，然后**重新连接 Wi-Fi**。

### 2. 在 Android API 30+ 上安装并信任 Proxyman CA {#2-install-and-trust-the-proxyman-ca-on-android-api-30}

在 Android 模拟器 API 30+ 上，需要额外的步骤才能信任 Proxyman 证书：

* 在 Google Chrome 中打开 http://proxy.man/ssl 下载证书。
* 打开 Settings 应用 -> Security -> Encryption & Credentials -> Install a certificate -> CA certificate -> Install anyway，然后在存储空间中选择 Proxyman CA 证书。

你可以在 Trusted credentials -> User 标签页中进行验证。

### 3. Android 真机或模拟器的连接不稳定 {#3-my-android-physical-device-or-emulator-connection-is-not-stable}

这可能是 Android 设备或模拟器本身导致的。一种可行的解决方法是将 Mac 或 Android 设备的 DNS 更改为 **8.8.8.8**。

* **在 macOS 上**：打开 System Settings -> Network -> Wi-Fi -> Details… -> DNS，然后将 **8.8.8.8** 添加到 DNS Servers 列表中。
* **在 Android 设备上**：打开 Wi-Fi 设置，并将 DNS 设置为 **8.8.8.8**。

更多信息请参阅 [GitHub issue #636](https://github.com/ProxymanApp/Proxyman/issues/636)。

### 4. 使用 Android 模拟器自动脚本时提示找不到 `adb` 命令 {#4-the-adb-command-is-not-found-when-using-the-android-emulator-automatic-script}

如果你在覆盖 Android 模拟器时遇到以下错误：

```
adb command line could not be found!!!
```

请安装 `adb` 命令行工具，然后重试。

* [如何安装 ADB](https://proxyman.com/docs/zh-cn/debug-devices/android-device/automatic-script-for-android-emulator#3-how-to-use-it)

### 5. 不确定如何在 Android 模拟器上安装并信任 Proxyman 证书？请使用 [Android 模拟器自动脚本](https://proxyman.com/docs/zh-cn/debug-devices/android-device/automatic-script-for-android-emulator) {#5-not-sure-how-to-install-and-trust-the-proxyman-certificate-on-an-android-emulator-use-the-automatic-script-for-android-emulator}
