Skip to content

Guides

Debug a mobile app

Capture and decrypt HTTPS from an iPhone or iPad on your Wi-Fi, find a failing API call, edit and resend it, and pause it at a breakpoint.

Your iPhone app makes a call that fails, and the Xcode console only shows a status code. This guide captures the app’s HTTPS traffic on your Mac, decrypts it, finds the failing request, resends it with a fix, and pauses it mid-flight so you can change it before it reaches the server. It finishes by removing the proxy and certificate from the device.

An iPhone or iPad on the same Wi-Fi network as your Mac The device sends its traffic to Cloak Proxy over the network
Cloak Proxy running, with the certificate trusted on this Mac See Install and the certificate page
An app you own or are authorized to debug Decrypting someone else’s traffic without permission is off limits

By default Cloak Proxy listens only on 127.0.0.1, so other devices can’t reach it. Turn that on first.

  1. Open Settings → Network (or Settings → General) and turn on Allow other devices to connect (phones, other computers).

    The Devices window’s iPhone & iPad tab also has an Allow Other Devices to Connect button that does the same thing.

  2. Note This Mac’s address shown below the toggle, for example 192.168.1.20, and the port (9090 by default).

    Turn on Allow other devices to connect, then apply and restart the proxy.

    1. Listening port (9090 by default)
    2. Allow other devices to connect
    3. Apply & Restart Proxy after changing it
    General settings showing the Port field set to 9090 and the Allow other devices to connect toggle

Point the device at Cloak Proxy and trust the certificate

Section titled “Point the device at Cloak Proxy and trust the certificate”

Open the Devices window (the Devices toolbar button) and choose iPhone & iPad.

The iPhone & iPad tab: Wi-Fi proxy, then the certificate.

  1. Allow Other Devices to Connect, if not done yet
  2. Wi-Fi proxy: your Mac's IP and port
  3. Scan to open the certificate page
  4. http://cloak.proxy also opens it in Safari
The iPhone and iPad device setup tab with Wi-Fi proxy details, a QR code, and certificate trust steps
  1. On the iPhone, open Settings → Wi-Fi, tap the ⓘ next to your network, then Configure Proxy → Manual. Enter your Mac’s address as the Server and 9090 as the Port.

  2. Install the certificate. Scan the QR code in the Devices window with the iPhone camera, or open http://cloak.proxy in Safari on the device, and download the certificate.

    The certificate page is served by Cloak Proxy itself. On iOS, download the PEM profile.

  3. On the iPhone, open Settings → General → VPN & Device Management and install the downloaded profile.

  4. Turn on full trust: Settings → General → About → Certificate Trust Settings, and enable trust for Cloak Proxy CA.

Use the app on the device. Its requests appear in the traffic list, grouped by app and domain in the sidebar. At first HTTPS shows as locked tunnels: Cloak Proxy relays them without reading them.

  1. Select the app in the Apps section of the sidebar, or a request from it.

  2. Click Enable SSL Proxying for All Requests in the bar above the table, or right-click the domain and choose Enable SSL Proxying for host.

    A locked tunnel. Enabling SSL Proxying closes it so the app reconnects decrypted.

    1. Enable only this host
    2. Or every domain from this app
    An encrypted tunnel to www.apple.com with buttons to enable SSL proxying for the host or for all domains from the app
  3. Enabling closes the open tunnels, so the app reconnects with decryption on. The next matching requests show method, URL, headers and bodies.

  1. Filter the list to the call you care about. Press <kbd>⌘</kbd> <kbd>F</kbd>, choose the field (URL, Host, Status Code, Response Body…) and a match mode, and type.

    The traffic list and inspector. The filter bar is at the top.

    1. Filter field and match mode (⌘F)
    2. Content chips: JSON, Form, GraphQL…
    3. Request and response tabs
    4. Response body, here a JSON tree
    The traffic list with a filter bar, request rows, and the request and response inspector below
  2. Click a failed request. A request that never reached the server shows No response with the reason (for example a DNS or TLS error).

    A failed request: the reason is shown in both the header bar and the response pane.

    1. Failed, with timing
    2. The failure reason
    3. No response pane
    A failed request inspector showing No response and a DNS lookup failure message
  3. Read the request and response tabs: Header, Query, Body, Cookies, Auth (JWT and Basic are decoded), and Raw. Use the response Body viewer’s Tree, Pretty, Raw or Hex modes.

Once you see what’s wrong, change the request and send it again — through Cloak Proxy, so your tools still apply.

Right-click the request and choose Edit and Repeat… (<kbd>⌥</kbd> <kbd>⌘</kbd> <kbd>E</kbd>). The Compose window opens prefilled with the request. Change the method, URL, headers or body and press Send (<kbd>⌘</kbd> <kbd>↩</kbd>).

Compose, prefilled by Edit and Repeat. Send goes through Cloak Proxy.

  1. Method and URL
  2. Send (⌘↩)
  3. Import cURL to paste a command
  4. Response appears below
The Compose window with method, URL, headers and an Import cURL button, and the response below

The resent request shows up in the main window under the app Cloak Proxy (Compose).

To change a request or its response while the app is waiting, set a breakpoint. The app stalls until you decide.

  1. Right-click the request and choose Tools → Breakpoint…, or open Tools → Breakpoint and add a rule. Creating it from a request fills in the matcher and turns the tool on.

    A breakpoint rule. Pause on the request, the response, or both.

    1. Tool on/off
    2. Matcher: method, URL, wildcard or regex
    3. Pause on request and/or response
    The Breakpoint tool with a rule matching GET api.example.com/v1/users and Pause on Request and Response checkboxes
  2. Make the device repeat the call. When it matches, the Breakpoint window opens and the status bar shows how many are paused.

    A paused request. Edit the method, URL, headers or body, then Execute.

    1. Request paused, with its rule
    2. Execute sends your edits
    3. Cancel sends the original
    4. Abort drops it
    The Breakpoint window with a request paused, showing editable method, URL, headers and body
  3. Edit the request and click Execute (<kbd>⌘</kbd> <kbd>↩</kbd>) to send your version, Cancel to send the original, or Abort to drop it.

  4. If the rule also pauses the response, the window reopens when the response comes back. Change the status, headers or body (use Quick status for common codes) and Execute.

    A paused response. Change the status, headers or body before the app receives it.

    1. Response paused
    2. Status code, with Quick status
    3. Format or Minify the JSON body
    The Breakpoint window with a response paused, showing a status code field, headers, and an editable JSON body with Format and Minify
  5. To release everything at once without edits, click Continue All.

When you finish, undo the changes on the device and the Mac:

  1. On the iPhone, remove the Wi-Fi proxy: Settings → Wi-Fi → ⓘ → Configure Proxy → Off.

  2. Remove the profile: Settings → General → VPN & Device Management, select Cloak Proxy CA, and remove it.

  3. On the Mac, turn off Breakpoint (and any other tool you enabled) in the Tools window or the Tools menu.

  4. Turn off Allow other devices to connect in Settings → Network when you no longer need device access.