How to use Charles Proxy on the Xcode 6 (iOS 8) Si

2019-01-16 01:00发布

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 ~/Library/Developer/CoreSimulator/Devices/.

10条回答
甜甜的少女心
2楼-- · 2019-01-16 01:50

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.

查看更多
叛逆
3楼-- · 2019-01-16 01:53

Update for iOS 9: You have to disable App Transport Security to use Charles!

http://www.charlesproxy.com/documentation/using-charles/ssl-certificates/

查看更多
Lonely孤独者°
4楼-- · 2019-01-16 01:58

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.

查看更多
混吃等死
5楼-- · 2019-01-16 02:01

Just (re)starting the Simulator after Charles starts fixed it for me.

查看更多
登录 后发表回答