What is Charles Proxy?
Charles Proxy sits between your app and the Internet. All networking requests and responses will be passed through Charles Proxy, so you’ll be able to inspect and even change data midstream to test how your app responds.
How does Charles Proxy work with mobile devices?
Go to Charles Proxy Download page and follow instructions to download and install it on your computer.
Configuring Charles Proxy and your mobile device
1. Configure Charles Proxy
After opening Charles Proxy go ahead and disable Windows Proxy / MacOS Proxy / Mozilla Firefox Proxy (they are enabled by default) as this will just generate extra data that is not needed when you are testing through a mobile device. Also, no need to install Firefox plugin.
2. Get proxy port number
In the task bar click "Proxy settings" and make a note of the proxy port number "8888".
3. Get the local IP address in the network
Click on Help > Local IP address and you'll see an IP address that is usually formatted as 192.168.x.x or 10.0.x.x
4. Add proxy server settings to your Android device
a) Go to “Settings”
b) Go to “Wifi”
c) Long tap to current wifi network
d) Click “modify network” option
e) Click “show advanced options”
f) Under “Proxy” change to option to “Manual”
g) Set phone so all internet traffic on mobile device runs through the PC by entering “Proxy hostname” (IP address from point 3) and “Proxy port” (8888)
h) Click “Connect/Save”
5. Install SSL certificates on your mobile device
To install Charles root certificate on Android device open https://chls.pro/ssl in your mobile browser and download the cert.
You're all set up now to track your mobile device traffic and record it on your computer through Charles Proxy
- Clear previous logs before you start testing new functionality.
- To install or remove certs in iOS system, follow iGeeksBlog tutorial.
- When all else fails, a restart of both PC and mobile device may solve issues, but make sure to Disable the Windows Proxy / MacOS proxy / Mozilla Firefox Proxy again.
- You should periodically update your certificates as they do expire.
- Some routers re-assign local IP addresses, so you should verify the IPv4 has not changed.