Cannot see iOS simulator traffic with charles proxy

我们两清 提交于 2019-12-11 07:58:31

问题


I have installed Charles proxy, then installed the root certificate and root certificate for iOS simulator. Then I ran the application of the simulator but I cannot see any request inside charles.

When I curl the same request with proxy it shows up in the Charles

curl --proxy 127.0.0.1:8888 -k -v https://example.com

回答1:


New16 may be on to something -

Not sure which simulator you use, but I assume that it uses your Mac's internet connection, unlike real devices that connect to Charlesproxy through the http port that you specify (8888 by default).

While http traffic proxied through that port will always be recorded by Charles, recording the traffic of desktop apps like your simulator is optional. Thus the simulator's traffic will only be recorded if you check the corresponding option in the "Proxy" menu. (In Charles on Windows, the available options are "Windows Proxy" and "Firefox Proxy", not sure what are the options on a Mac.)




回答2:


Xcode simulators use the host OS's network settings so when you change anything in the System Preferences or in the Charles Proxy app, you have to restart the simulator.

You should complete the following settings:

1) Enable this option in the Charles app: Proxy > macOS Proxy (It will set your localhost as a proxy on the System Preferences > Network > Advanced > Proxies tab)

2) On iOS 10.3 or later, navigate to General > About > Certificate Trust Settings and enable full trust for the Charles Proxy certificate.

3) Restart the Xcode simulator



来源:https://stackoverflow.com/questions/40489395/cannot-see-ios-simulator-traffic-with-charles-proxy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!