I'm using Charles to debug my apps- on both android and ios. something rather strange happens, on the secured connection, after I have installed Charles CA on the devices.
On IOS, Charles will show the request to the hostname in the list of connections, and it looks great.
However, on android, it will only show the IP. I have to open the request and check for the hostname header to figure out the hostname- and that's pretty annoying.
Any way around this?
Check what's your current local IP address (Charles → Help → Local IP Address). On your mobile, navigate to Settings → Wi-Fi → Choose the common Wi-Fi connection for both phone and System → Modify Network → Show Advance Settings → Proxy=Manual → Proxy Hostname=Local IP address → Port=8888 and save.
Check the proxy configuration. Open Charles Proxy, if it is not already open. Open your mobile device's browser and navigate to a site. Grant access when prompted that a device is trying to connect to your network. You should now see your mobile device's traffic in your Charles Sequence log.
iOS devices If you are on iOS 10.3 or later, open the Settings. app and navigate to General > About > Certificate Trust Settings, and find the Charles Proxy certificate, and switch it on to enable full trust for it (More information about this change in iOS 10).
Emulators for API 25+ have a simulated wifi access point called AndroidWifi: https://developer.android.com/studio/run/emulator#wi-fi
Go to your emulators wifi settings, connect to the AndroidWifi, then hold down on it and select modify network. Enter your Charles Proxy hostname and port. It should connect to the proxy and you should see domain names in the requests.
Don't use the proxy settings provided in the emulator's extended controls.
This happens because Android emulator is a VM and not just a mac os process like the iOS simulator. To be able to see hostnames using Android emulator (Tested on Android 8.0) you have to go to Setting -> Network & Internet -> Mobile network -> Access point names -> Click on the access point and set Proxy and Port properties to your charles local address (You can find it on Charles -> Help -> Local IP Address)
UPDATE:
Google has changed this on the last version of Android emulator. Now you have to add a new APN. Just create a new APN with any name and the APN set to "http://", proxy to 10.0.2.2 and port to 8888
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With