-->

How to connect to iPhone's webkit debugger?

2019-04-09 04:38发布

问题:

new iOS 6 feature is, that you can debug html and javascript running on device or simulator in desktop safari. I suppose, that this feature is based on Webkit Remote Debugging Protocol.

How can I connect to webkit running on iPhone without desktop Safari?

I can do this for mobile Chrome running on Android using websockets, but how can I do that for iOS devices?

回答1:

The ios-webkit-debug-proxy project (from Google!) does this.



回答2:

You want to look at this code https://github.com/leftlogic/remote-debug/tree/master/safari - although it fails when it actually comes to RPC calls that use __rpc_forwardSocketData.

If you've got any ideas why several of us are interested!



回答3:

You need to open up the iPhone Simulator and browse to a website.

Then open Safari and choose "Develop" from the menubar. There is a the option called "iPhone Simulator".

If you hover over this you can see all of the open websites of the simulator.

This gives you the same inspector Safari uses. You can even see hovered elements in the iPhone Simulator.