Mitmproxy and Android
Debugging network traffic for your app can be useful, and sometimes necessary if the data is not what is expected or inconsistent.
brew install mitmproxy
I’ll leave it up to you to explore its greatness, I just wanna clarify the android setup.
Choose a port (ex. 8888) and start the program:
mitmproxy -p 8888:
If you prefer a web interface
Find your local machine IP address, on OSX this can be found in network preferences. For example
Alternatively, find your public IP address on whatismyip.com. For example
a) Open the extended controls from the emulator.
b) Go to Settings and click on the Proxy tab. Enter your IP address and a port.
Download a proxy app and enter the same settings.
a) Open the mitmproxy portal to download its HTTPS certificate:
b) Download the Android certificate and install it. Name it whatever your want.
Configuring this is possible only during debugging using the
<?xml version="1.0" encoding="utf-8"?> <network-security-config> <debug-overrides> <trust-anchors> <!-- Trust preinstalled CAs --> <certificates src="system" /> <!-- Additionally trust user added CAs --> <certificates src="user" /> </trust-anchors> </debug-overrides> </network-security-config>