Debugging network requests with iOS Simulator, network request data is not showing

Berlin Brown picture Berlin Brown · Apr 3, 2015 · Viewed 24.4k times · Source

I am trying to debug the network requests for a hybrid/webview cordova based application in the ios simulator, actually see the network requests in the Safari Web Inspector. I am trying to use the Web Inspector within Safari to monitor the network requests to the server but all I see is the "timeline" graph, I don't see the actual URI requests. Is there a way to enable this?

I build my application through xcode. Launch the iOS simulator with iPad2 selected/iOS 8.1. I then launch Safari and select the "ios simulator/index.html" to launch the web inspector. And then click on network requests. The resources tab pane is empty when I make web request calls. Is there a way to fix this so I can see the url requests?

  • Xcode: 6.1.1
  • Safari: 7.1.3
  • OSX: 10.9.5

Answer

Mojtaba picture Mojtaba · Apr 9, 2015

I'm not quite sure if it's even possible to do that via web inspector or not but put option 1 just in case. I highly recommend you to go with Option 2 tho.

Option 1

First make sure you don't have anything filtered, then make sure recording is on as shown in picture.

Steps to verify inspector is working

Option 2. RECOMMNDED

Use an http monitoring tool. They are design to do that specific task plus you get many more options such as breakpoints, etc.

  • Charles Proxy. (MAC) The best IMHO. You can set breakpoints and alter request/response if needed. And many other features.
  • HttpScoop (MAC) Easier to use, but less functionality.
  • fiddler (WINDOWS) Just in case.

PS. Some one might say Wireshark, I know but it's too complicated for such work.

[UPDATE 1] To make it clear you don't need to set any proxy on iOS simulator to get these tools working. In case of SSL connections you want to use charles and follow their SSL guideline.