It seems that the directory for the iOS Simulator has changed. It used to be in ~/Library/Application\\ Support/iPhone\\ Simulator/
and now it\'s in ~/Lib
Just (re)starting the Simulator after Charles starts fixed it for me.
To me, this is what worked.
I did same thing as we do in device.
I have to do this on 3 simulator instances, as XCUI automation testing can spin 3.
According to charles documentation
The iOS Simulator should use the system proxy settings. If it doesn't, please try quitting and restarting the iOS Simulator. As of Xcode 6 it appears to be important that Charles is running and set as the Mac OS X system proxy before you run the iOS Simulator.
Read Here
So just quit your simulator, open charles and then run the app again. After that you can track your network calls.
NOTE: Your network calls will fail if you quit Charles. So you will need to either quit the simulator and run it again or open Charles again.
Check this out:
As of Charles v3.9.3 there is an item in the Help menu, "Install Charles CA SSL Certificate in iOS Simulators", which will automatically install Charles's SSL CA certificate in your iOS Simulators.
Alternatively, you can change your code so that NSURLConnection accepts any SSL certificate. Please see the question and answer on Stack Overflow: How to use NSURLConnection to connect with SSL for an untrusted cert?
You can check it on this link: http://www.charlesproxy.com/documentation/faqs/ssl-connections-from-within-iphone-applications/
The 'Install Charles Root Certificate in iOS simulators' does not work in the current version of CharlesProxy (3.11) with Xcode 7 / iOS 9 simulators.
Instead, use the 'Install Charles Root Certificate on a Mobile Device or Remote Browser...' option. This will give you a url for the certificate.
If you open this url in Safari in the simulator, you will then be given the option to install the certificate.
You still then need to disable app transport security. I don't understand why this is necessary when you have the certificate installed; I guess CharlesProxy does not use sufficiently large keys/signatures.
Steps for iOS simulator.
Steps for iPhone/iPad.
Goto Charles Menu -> Help -> SSL Proxying -> Install Charles Ceritificate on a Mobile device or Remote browser -> Select -> popup appear with below steps `
Configure your device to use Charles as its HTTP Proxy on 192.168.0.100:8888, then browser to chls.pro/ssl to download and install the certificate.
Goto iPhone settings -> Wifi -> click selected wifi -> Http proxy -> Configure proxy -> select Manual -> Give server as 192.168.0.100 and port as 8888 -> Save
Goto iPhone browser -> Load chls.pro/ssl -> It will show below popup `
The website is trying to download a configuration profile. Do you want to allow this? Ignore button and Allow button
Click Allow button -> It will download the profile