Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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
like image 321
Berlin Brown Avatar asked Apr 03 '15 17:04

Berlin Brown


People also ask

How do I debug iPhone simulator?

You'll need to go to Settings > Advanced and check the Show Debug Menu option. Then you'll see the option to open the web inspector for the Simulator right from that menu. With the Web Inspector open, you can debug inside the Simulator just like you could right in a desktop browser with DevTools.

Where is iOS simulator data stored?

type: ~/Library/Application Support/iPhone Simulator.

How do I access iOS simulator files?

First, copy the path to the app folder from Xcode console. Then open Finder, click on Go -> Go to Folder and paste the application directory path. You will now be able to browse all the files in your application folder.

How do I use the console log in iOS simulator?

View log output in Console You can either open the Console application from the iOS simulator or through the Applications folder. To open Console from the iOS simulator, from the menu bar, select Debug > Open System Log .... To open Console from the Applications folder: Click Applications.


1 Answers

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.

like image 80
Mojtaba Avatar answered Sep 21 '22 13:09

Mojtaba