We want to capture our ios application’s network traffic. This is something we usually do on our physical Mac boxes with a proxy called Charles (www.charlesproxy.com). Charles has a headless mode (non GUI command line mode) that fits perfectly our need.
We do this with the following instructions:
- Download Charles via brew
- Install charles root certificate into the simulator’s Keychain
- Get the VM’s current ip address into $url
- Start Charles in headless mode on port $url:8888
- Reconfigure the network via networksetup –setwebproxy $url:8888 and -setsecurewebproxy $url:8888 and export http(s)_proxy environment variables…
- Run the application in the simulator
- Dump the traffic through the export feature of Charles rest-api.
This works like a charm on our macs.
The same does not work in the bitrise virtual machines, no errors are raised but there’s no traffic intercepted in the proxy: after a long search, I found out with tcpdump that the simulator does NOT use the system wide network settings, and therefore does not go out through port 8888. The tcpdump shows that the packets go straight out to internet, ignoring the proxy. In other words, the simulator doesn’t honor any proxy settings, neither those or networksetup neither those via the http(s)_proxy env. variables.
Is this something you are aware of?
Do you know of other solutions to capture outgoing traffic from the simulator? I guess using another proxy like burp won’t get us forward, as it looks more like a problem with the simulator not using the network settings…