Devices and runtimes
iPhone and iPad
Capture and decrypt HTTPS traffic from a real iPhone or iPad by setting its Wi-Fi proxy to your Mac and trusting the Cloak Proxy certificate.
To debug an app on a real iPhone or iPad, point the device’s Wi-Fi proxy at your Mac and install the Cloak Proxy certificate on it. The device and the Mac must be on the same Wi-Fi network. The iPhone & iPad page of Device & Runtime Setup shows your Mac’s address, the port and a QR code for the certificate.
Capturing the iPhone or iPad’s own apps without a Mac? In version 1.1 of the iPhone and iPad app, the Cloak Proxy app can do it on the device, in the background too, with VPN capture. See Cloak Proxy for iPhone and iPad.
The iPhone & iPad page. The warning and button appear only while other devices can't connect.
- Lets other devices connect and restarts the proxy
- The Server and Port to enter on the iPhone
- QR code that opens the certificate page on the iPhone
- The certificate page address to open in Safari
Before you start
Section titled “Before you start”- Your Mac and the iPhone or iPad are on the same Wi-Fi network, and the network lets devices reach each other. Guest networks and some office networks block this.
- Cloak Proxy is running. It doesn’t need the macOS proxy on to capture a device.
- You know which hosts you want to decrypt. Add them in SSL Proxying, or HTTPS from the device passes through encrypted.
Let the device connect
Section titled “Let the device connect”By default Cloak Proxy only accepts connections from your Mac. When that’s the case, the iPhone & iPad page shows Other devices can’t connect yet.
-
Open Device & Runtime Setup (click Devices in the toolbar) and choose iPhone & iPad in its sidebar.
-
Click Allow Other Devices to Connect.
Cloak Proxy turns on Allow other devices to connect (phones, other computers) and restarts the proxy right away. If the macOS proxy was on, it’s turned off and back on during the restart. The warning disappears.
You can also turn this on in Settings › General. To accept only your iPhone, add its address to Allowed devices in Settings › Network. See Other devices and access control.
Set the Wi-Fi proxy on the iPhone
Section titled “Set the Wi-Fi proxy on the iPhone”The tab’s first section, 1. Set the Wi-Fi proxy on the iPhone, shows the values to enter. Server is your Mac’s IP address on the local network (for example 192.168.1.20) and Port is the port Cloak Proxy listens on (9090 by default). Both are selectable so you can copy them.
-
On the iPhone or iPad, open Settings › Wi-Fi.
-
Tap the ⓘ button next to the network you’re connected to.
-
Scroll down and tap Configure Proxy.
-
Choose Manual.
-
Enter the Server and Port shown in Cloak Proxy. Leave Authentication off.
-
Tap Save.
Open any website on the device. Its requests appear in Cloak Proxy’s traffic list, and the sidebar lists the device under Devices, with the apps it used under it. See See traffic by device and app.
Install the certificate
Section titled “Install the certificate”The tab’s second section, 2. Install the certificate, gives you two ways to open the certificate page.
Point the iPhone’s Camera app at the QR code in Cloak Proxy and tap the link that appears. The QR code opens http:// followed by your Mac’s address and port (for example http://192.168.1.20:9090/), so it works even before you set the Wi-Fi proxy, as long as other devices may connect.
After you set the Wi-Fi proxy, open Safari and go to http://cloak.proxy. Cloak Proxy answers this address itself, so it only works while the device’s proxy points at Cloak Proxy.
Both show the same page, titled Cloak Proxy. Its first button, Install on iPhone or iPad Since 0.2.3, downloads the certificate as a configuration profile, which Safari offers to install. (The Download certificate buttons below it are for other systems; on an iPhone or iPad, Safari may only save those to Files.) Then:
-
Tap Install on iPhone or iPad.
Safari asks whether to allow the configuration profile to download. Tap Allow, then Close.
-
Open Settings › Profile Downloaded, near the top of Settings. You can also find it in Settings › General › VPN & Device Management.
-
Tap the profile. It’s named Cloak Proxy CA followed by your Mac’s name in parentheses, for example Cloak Proxy CA (MacBook Pro).
-
Tap Install, enter the device passcode, and confirm with Install again.
-
Open Settings › General › About › Certificate Trust Settings.
-
Under Enable full trust for root certificates, turn on the switch for Cloak Proxy CA, then tap Continue.
Without the last step, iOS installs the profile but apps still reject the certificates Cloak Proxy creates, and HTTPS requests to hosts in SSL Proxying fail.
Check that it works
Section titled “Check that it works”-
Add a host your app uses to SSL Proxying, for example
api.example.com. -
Open your app on the device and use the feature you’re debugging.
-
In Cloak Proxy, select your app under the device in the sidebar’s Devices group. Requests to
api.example.comshow their full headers and bodies.
If an app’s requests fail only while the proxy is on, the app may pin its certificates. Pinned apps reject any certificate except their own, and Cloak Proxy can’t decrypt them. Remove the host from SSL Proxying to let that app’s traffic pass through encrypted. See SSL Proxying.
See traffic by device and app
Section titled “See traffic by device and app”Cloak Proxy names each request from a device by the app that sent it, read from the request’s User-Agent header, since a Wi‑Fi proxy can’t see which app opened a connection.
User-Agent |
Shown as |
|---|---|
Weather/2.1 CFNetwork/1490 Darwin/23.2.0 (most iPhone and iPad apps) |
Weather |
| Safari, Chrome, Firefox, Edge and other browsers | The browser’s name |
| An app’s web view | Web view |
Dart/3.1 (dart:io) (Flutter apps) |
Dart app |
okhttp/4.12.0 |
OkHttp app |
No User-Agent, or one that names no app |
The device itself |
Encrypted HTTPS that isn’t decrypted usually carries no User-Agent, so those tunnels stay under the device. iOS often sends one when it opens a tunnel, and then the tunnel is named by its app too. Once a host is decrypted, each request inside it is named by its own User-Agent.
The sidebar lists every device under Devices, with its request count, and the apps it used under it. Click the device for everything it sent, or an app for that app on that device only. The traffic list’s Client column reads, for example, iPad · Weather.
A device is named by its kind and address, for example iPad · 192.168.1.30. The kind comes from any User-Agent that says it, such as Safari’s (iPad; CPU OS 17_0 …), and is remembered for the address; until then the device shows as Device. To give a device your own name, right-click it in the sidebar and choose Rename…. Names are kept per IP address.
Rules limited to apps, muting, SSL Proxying by app and Privacy Map work with these names. An app’s name covers that app on every device and on your Mac, and a device’s address, for example 192.168.1.30, covers everything from that device. See Sidebar › Devices.
Decrypt everything from a device
Section titled “Decrypt everything from a device”Select an encrypted tunnel from the device. Below Enable only host, the inspector offers Decrypt all of this device’s HTTPS… (or Decrypt all HTTPS from app… for a tunnel its app was named for), and says To decrypt, this device needs Cloak Proxy’s certificate., with Set up iPhone & iPad… to open this setup at the certificate step.
Decrypt all of this device’s HTTPS… asks first. Choose Set Up the Certificate… if the device doesn’t trust it yet, or Decrypt Anyway.
Undo the setup
Section titled “Undo the setup”Remove the proxy and the profile when you’re done. The tab reminds you: Remove the profile and the Wi-Fi proxy when you’re done.
-
On the device, open Settings › Wi-Fi, tap ⓘ next to the network, tap Configure Proxy, choose Off, and tap Save.
Do this before you quit Cloak Proxy or leave the network. While the proxy points at a Mac where Cloak Proxy isn’t running, the device can’t reach the internet over that Wi-Fi network.
-
Open Settings › General › VPN & Device Management, tap the Cloak Proxy CA profile, tap Remove Profile, and enter the passcode. This also removes it from Certificate Trust Settings.
-
On the Mac, open Settings › General, turn off Allow other devices to connect (phones, other computers), and click Apply & Restart Proxy.
If nothing arrives
Section titled “If nothing arrives”The iPhone & iPad page ends with If nothing arrives. While the page is open, the Doctor checks this Mac and lists what stops the device reaching Cloak Proxy: Allow other devices to connect off, the macOS firewall blocking incoming connections, or Internet Sharing on. Open the Doctor shows everything it checked.
What the Doctor found on this Mac, and what to check on the device.
On the iPhone or iPad:
- Turn off VPN apps. A VPN carries the device’s traffic and skips the Wi-Fi proxy.
- Turn off iCloud Private Relay (Settings › your name › iCloud › Private Relay), and Limit IP Address Tracking for this network (Settings › Wi-Fi › ⓘ). Both can send Safari’s and some apps’ traffic over their own relay.
- Use the same Wi-Fi network as the Mac, not mobile data or a guest network.
Troubleshooting
Section titled “Troubleshooting”| Symptom | What to check |
|---|---|
| The device can’t load any page | Cloak Proxy is running, Allow other devices to connect is on, the Server and Port match the tab, and the device’s address is in Allowed devices (if you use the list). |
The QR code or http://cloak.proxy doesn’t open |
The QR code needs other devices to be allowed. http://cloak.proxy also needs the Wi-Fi proxy set. |
| HTTPS requests show as tunnels | The host isn’t in SSL Proxying. |
| HTTPS requests fail with a certificate error | Full trust isn’t turned on in Certificate Trust Settings, or the app pins its certificates. |
| A banner says the device doesn’t trust Cloak Proxy’s certificate | Install the profile and turn on full trust, then decrypt again. See Decrypt everything from a device. |
| Safari saves the certificate to Files instead of installing it | Use Install on iPhone or iPad at the top of the certificate page. |
| Nothing appears for one app | The app may not use the system proxy. See Apps that ignore the proxy. |
| Nothing arrives although the Wi-Fi proxy is set Since 0.5.1 | See If nothing arrives: the Mac’s firewall, Internet Sharing, a VPN or Private Relay on the device. |
| The device is plugged into the Mac by USB | With Internet Sharing on, it may use the Mac’s connection instead of the Wi-Fi proxy. Turn off Internet Sharing or unplug it. |
For more, see Troubleshooting.