Using Charles with Mobile Applications

Ronell Lukasik
4 min readJun 13, 2024

--

I wrote this article earlier on how to use the Network Inspector within Android Studio to monitor network calls. In this article I will explain how to set up and use Charles Proxy for both iOS and Android applications. Charles does have additional functionality that you may find useful.

First, download Charles and either purchase a license or use the free trial. If you already have it installed, go to Help > Check for Updates.

From the Help menu, select SSL Proxying and select to Install Charles Root Certificate.

Verify that the certificate is trusted. If you see a red ‘X’ then you will need to right click and Trust the certificate.

Then select the option to Save Charles Root Certificate and save it to a location on your machine.

🌟 If you continue to have trouble connecting after doing the following for iOS or Android, you may need to select Reset Charles Root Certificate and resave off the new certificate. This is sometimes necessary especially if you haven’t used Charles for a while or if you got a new license.

Go to Proxy > SSL Proxying Settings > Enable and add *.* or specific site information.

iOS

It is typically best practice to launch your application on the iOS simulator after having Charles already running or else you may have trouble connecting.

Drag and drop the root certificate that you saved onto the iOS simulator.

On the iOS simulator, go to Settings -> General -> About -> Certificate Trust Settings. You should see ‘Charles Proxy CA’. Make sure its enabled.

From Charles, go to the Proxy menu and select macOS Proxy and select to Grant Privileges.

You should now be able to see events being logged in Charles. 🎉

Android

Go in the device emulator Settings > Security > Encryption & Credentials > Install a Certificate > CA Certificate > Click Install Anyway > Drag and Drop the saved root certificate onto the Simulator. In the upper left corner, select the Open from menu button and select Downloads. Double click on the Charles root cert. You should see the notification saying that the cert was installed. You can ensure that it was installed correctly though by going back to the Encryption & Credentials list and selecting Trusted Credentials. Select User and you should see something similar to this:

In Charles, select Help > SSL Proxying > Install Charles Root Cert on a Mobile Device.

You should get a message like this:

On the Device emulator, go to Settings > Network & Internet > Internet > Edit AndroidWifi. Select Manual for Proxy and enter the hostname and port as shown from the message above then select Save.

You should now be able to see events being logged in Charles. 🎉

Additional Notes

  • If you are behind a VPN, you may have trouble getting Charles to work. For example, we were unable to use Charles while having GlobalProtect enabled. We were only able to monitor calls successfully when having GlobalProtect disabled. You should also ensure that you do not have any certificates installed on the simulator/emulator for GlobalProtect (Device > Erase all contents and settings, or Wipe Data) or they are disabled.
  • If you are still having issues connecting, try rebooting your machine. Especially after the initial Charles certificate setup.

--

--

Ronell Lukasik
Ronell Lukasik

No responses yet