Connecting your iOS device to Charles Proxy is a straightforward process that allows you to inspect and debug network traffic from your iPhone or iPad directly through your computer.
Prerequisites for Connecting iOS to Charles Proxy
Before you begin, ensure you have the following:
- Charles Proxy Installed: Charles Proxy should be installed and running on your macOS or Windows computer. You can download it from the official Charles Proxy website.
- Shared Wi-Fi Network: Both your computer running Charles Proxy and your iOS device must be connected to the same Wi-Fi network.
Step-by-Step Guide to Connect iOS to Charles Proxy
Follow these steps to successfully configure your iOS device to use Charles Proxy:
Step 1: Find Your Computer's IP Address
Your iOS device needs to know where to send its network traffic. This is your computer's local IP address.
- On macOS:
- Go to System Settings (or System Preferences).
- Click on Wi-Fi.
- Click the Details button (often an "i" icon or "..." next to your connected Wi-Fi network).
- Your IP address will be listed next to "IP Address."
- On Windows:
- Open Command Prompt (search for
cmd
). - Type
ipconfig
and press Enter. - Look for your active Wi-Fi adapter (e.g., "Wireless LAN adapter Wi-Fi") and find the "IPv4 Address."
- Open Command Prompt (search for
Example: Your computer's IP address might be 192.168.1.100
.
Step 2: Configure Proxy Settings on Your iOS Device
Now, you'll tell your iOS device to route its network traffic through your computer running Charles.
- On your iOS device, open the Settings app.
- Tap on Wi-Fi.
- Tap the information icon (an "i" in a circle) next to the Wi-Fi network your device is currently connected to (it must be the same network as your computer).
- Scroll down to the HTTP Proxy section.
- Select Manual.
- Enter the following details:
- Server: Enter the IP address of your computer that you found in Step 1.
- Port: Enter
8888
. This is the default port Charles Proxy listens on. - Authentication: Leave this Off unless your network setup specifically requires it.
Here's a quick summary table for your iOS proxy settings:
Setting | Value |
---|---|
HTTP Proxy | Manual |
Server | Your Computer's IP Address |
Port | 8888 |
Auth | Off (typically) |
Step 3: Allow the Connection in Charles Proxy
Once you've configured your iOS device, it will attempt to connect to Charles.
- On your computer, a Charles Proxy Connection Request dialog box will appear.
- Click Allow to permit your iOS device to connect and proxy traffic through Charles.
Step 4: Enable SSL Proxying for HTTPS Traffic (Crucial!)
To inspect encrypted HTTPS traffic (which most modern apps and websites use), you need to enable SSL Proxying in Charles and install a certificate on your iOS device.
- In Charles Proxy (on your computer):
- Go to Proxy > SSL Proxying Settings...
- Check the box for Enable SSL Proxying.
- In the "Include" section, click Add.
- For Host, enter
*
(to proxy all hosts) or specific hosts likeapi.example.com
. - For Port, enter
443
(the standard HTTPS port) or*
for all ports. - Click OK on both dialogs.
Step 5: Install Charles SSL Certificate on Your iOS Device
Your iOS device needs to trust Charles Proxy as a legitimate intermediary for encrypted connections.
- On your iOS device, open Safari (it must be Safari, not another browser).
- Navigate to the URL:
chls.pro/ssl
- Safari will prompt you to download a configuration profile. Tap Allow.
- Once downloaded, go to Settings > Profile Downloaded (this option appears immediately after download).
- Tap Install in the top right corner, enter your passcode if prompted, and tap Install again.
- After installation, you must enable full trust for the certificate. Go to Settings > General > About > Certificate Trust Settings.
- Under "ENABLE FULL TRUST FOR ROOT CERTIFICATES," toggle on the switch for Charles Proxy CA. Tap Continue on the warning.
Step 6: Verify the Connection
With all settings applied, you can now check if Charles Proxy is successfully capturing traffic.
- Open any app or web browser (Safari, Chrome, etc.) on your iOS device.
- Generate some network traffic (e.g., visit a website, refresh an app's feed).
- Look at the Charles Proxy interface on your computer. You should see network requests appearing in the "Structure" or "Sequence" view.
Troubleshooting Tips
- Same Wi-Fi Network: Double-check that both your computer and iOS device are connected to the exact same Wi-Fi network.
- Firewall: Ensure your computer's firewall is not blocking incoming connections to Charles Proxy on port 8888.
- VPN: Disable any VPNs running on either your computer or your iOS device, as they can interfere with proxying.
- SSL Trust: If you see "Unknown" or "SSL Handshake Failed" errors in Charles, revisit Step 5 to ensure the Charles SSL certificate is both installed and fully trusted on your iOS device.
- Restart Charles: Sometimes, restarting Charles Proxy can resolve connection issues.