To install the Charles Proxy certificate on an iOS simulator using the `simctl` CLI, follow these steps:
1. Open Charles Proxy on your Mac and go to Help > SSL Proxying > Save Charles Root Certificate. Save the certificate to your desktop or another easily accessible location.
2. Open Terminal on your Mac.
3. List the available simulators using the following command:
xcrun simctl list
This will show you the available devices and their UDIDs.
4. Copy the UDID of the simulator you want to install the certificate on.
5. Run the following command, replacing `
xcrun simctl keychain booted add-root-certificate ~/Desktop/charles-ssl-proxying-certificate.pem -u <UDID>
This will install the Charles Proxy certificate on the specified simulator.
6. Open the simulator and go to Settings > General > About > Certificate Trust Settings.
7. Under "Enable full trust for root certificates," turn on trust for the Charles Proxy certificate.
After following these steps, the Charles Proxy certificate should be installed and trusted on the specified iOS simulator, allowing you to capture and inspect HTTPS traffic using Charles Proxy.
Citations:[1] https://www.charlesproxy.com/documentation/using-charles/ssl-certificates/
[2] https://discussions.apple.com/thread/252739922
[3] https://docs.tealium.com/platforms/ios-swift/charles-proxy-iosdevice/
[4] https://stackoverflow.com/questions/67283763/unable-to-install-charles-root-certificate-on-ios-simulator-14-5
[5] https://www.detroitlabs.com/blog/how-to-set-up-charles-proxy-for-an-ios-simulator/