How to inspect your app’s HTTPS traffic on iPhone and Android
The bug only reproduces on a phone. Server logs show the status code but not the request body, and app logs show only what someone thought to write there. To see what the app actually sent, route the phone’s traffic through a proxy on your computer. In Microkoi Bench, that takes five minutes: the proxy, a certificate by QR code and recording only your API hosts.
Why logs aren’t enough
A log shows what was written to it. The authorization header, the body after serialization and the retry after a lost connection usually aren’t there. And that’s often exactly where a phone differs from an emulator: the system language, an expired token, a mobile network.
A proxy sees the whole exchange: the address, headers, body, status code and response time. No changes to the app’s code.
What you need
- A computer with Microkoi Bench and a phone on the same Wi-Fi network.
- The proxy running: “Traffic” → “Start”.
- For Android, a debug build of your app, covered in step 4.
Step 1. Open the proxy to the network
By default, the proxy accepts connections only from this computer. In the “Traffic” section, click “Device” and turn on “Allow connections from the local network”. If the system asks whether to allow incoming connections, choose “Allow”.
While connections are allowed, any device on this network can use the proxy without a password. The green “Device” button in the “Traffic” header reminds you of that. Open the proxy at home or in the office, not on a public network.
Step 2. Set the proxy on the phone
The dialog shows “Server”, the computer’s address on the network, and “Port”, 9090 by default. Copy either one with its “Copy” button.
| Device | Where to set the proxy |
|---|---|
| iPhone and iPad | “Settings” → “Wi-Fi” → ⓘ next to the network → “Configure Proxy” → “Manual”. Leave authentication off |
| Android | “Settings” → “Wi-Fi” → network → “Edit” → “Advanced options” → “Proxy” → “Manual” |
| Android emulator | Emulator proxy settings: server 10.0.2.2, the proxy port |
| iOS simulator | The computer’s system proxy settings: 127.0.0.1, the proxy port |
Step 3. Install the certificate by QR code
Without the certificate, Bench sees only the host a secure connection goes to. To read HTTPS contents, the phone has to trust the Bench root certificate. It’s created on your computer, and its private key never leaves it.
Scan the QR code from step 3 of the dialog with the camera. The “Microkoi Bench certificate” page opens, served by the proxy itself. If the proxy is already set on the phone, the same page opens at http://microkoi.cert.
- iPhone: “Download certificate” → “Allow”, then “Settings” → “Profile Downloaded” → “Install”. The last step is easy to miss: in “Settings” → “General” → “About” → “Certificate Trust Settings”, turn on full trust for the Bench certificate.
- Android: “Download certificate”, then “Settings” → “Security” → “Encryption & credentials” → “Install a certificate” → “CA certificate”. The path varies by manufacturer: if the item isn’t there, search settings for “CA certificate”.
Compare the “SHA-256 fingerprint” at the bottom of the page with “Settings” → “Root certificate” → “Fingerprint” in Bench. If they match, it’s your certificate.
Step 4. An Android debug build
Since Android 7, apps don’t trust certificates installed by the user. The Bench certificate will be on the phone, and your app’s HTTPS still won’t be readable. Allow it for the debug build only: the debug-overrides block applies only while the build is a debug one.
<network-security-config>
<debug-overrides>
<trust-anchors>
<certificates src="user" />
</trust-anchors>
</debug-overrides>
</network-security-config>Reference the file in the manifest: the android:networkSecurityConfig="@xml/ attribute on the application element. The release build still trusts only system certificates. On iPhone, nothing like this is needed.
Step 5. Keep only your API in the list
A phone constantly talks to mail, the cloud and the app store. In the filter row, click the button with a dot in a frame: it shows the current rule, for example “All hosts”. In the “Recording” window, choose “Only selected”, add your API hosts, for example api.example.com, and click “Save”. Other connections go straight through, without decryption or recording, and mail and messengers keep working.
Open the app. Step 4 of the dialog shows the phone’s address and the time of its last request, and the list shows the app’s requests. Select a row: the request and response open below, and the Raw tab shows them in full.
If you don’t see any requests
| What you see | What to do |
|---|---|
| The phone isn’t in step 4 of the dialog | Check that the phone and the computer are on the same network and that the system allowed incoming connections for Bench |
A CONNECT row with the status “failed” | The phone doesn’t trust the certificate. On iPhone, turn on full trust; on Android, check the debug build |
| The phone’s browser shows up, the app doesn’t | A Flutter app doesn’t read the proxy from Wi-Fi settings: point its HTTP client at the proxy in code, in the debug build |
| One app’s connection drops | It checks the server certificate itself. Exclude its hosts in the “Recording” window |
When you’re done
- Remove the proxy from the phone’s Wi-Fi settings. If Bench is closed and the proxy stays, the phone can’t reach the internet on this network.
- Remove the Bench certificate from the phone.
- Turn off “Allow connections from the local network”.
What to do with the request you found is covered in “Can’t reproduce the bug? How to find the cause in the traffic”.
Connected your phone? Write to beta@microkoi.com: which device and system, what worked and where you had to search. We read every email.