5

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?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Jan
  • 410
  • 1
  • 7
  • 15
  • weinre works for iOS devices; I use it via Chrome on a Linux machine to debug Android and iOS both. – Pointy Jan 11 '13 at 14:56
  • ... well when I say it "works", I mean it functions up to the limits of its abilities. – Pointy Jan 11 '13 at 14:56
  • possible duplicate of [Debug iOS 6 Safari using latest Chrome DevTools](http://stackoverflow.com/questions/11361822/debug-ios-6-safari-using-latest-chrome-devtools) – Yogesh Suthar Jun 05 '13 at 04:26

3 Answers3

4

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

Chris Lundie
  • 6,023
  • 2
  • 27
  • 28
  • The proxy recommends that [for Chrome DevTools](https://github.com/google/ios-webkit-debug-proxy#chrome-devtools), you should use `remotedebug-ios-webkit-adapter`, which [does not currently work](https://github.com/RemoteDebug/remotedebug-ios-webkit-adapter/issues/138#issuecomment-649772774). – Dan Dascalescu Jun 27 '20 at 20:18
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!

Andy Davies
  • 5,794
  • 2
  • 26
  • 21
  • Code above now works (or a pull request for a fix issued) http://www.libimobiledevice.org/ might also be of interest to you. – Andy Davies Jan 30 '13 at 12:51
  • Yes. Webkit protocol communicates with iphone through lockdown protocol and usbmuxd socket. Desktop Safari starts ssl session through lockdownd protocol and then somehow starts webkit debugging session on remote device. Problem is the ssl session. I can sniff those packets, but I cannot decode them. – Jan Feb 04 '13 at 09:13
  • 1
    This project shows how to do it for iOS Simulator https://github.com/andydavies/node-iosdriver physical iPhone/iPad are next on my radar – Andy Davies Feb 06 '13 at 20:35
  • I tried to use libimobiledevice and I managed to start webinspector service (well I hope it is started). I also managed to forward iphone's webinspectord to local port. But now what? I tried to modify node-iosdriver to communicate with my local port, but it does nor work... any ideas? – Jan Feb 07 '13 at 13:07
  • node-iosdriver has only been tested against the simulator and there are some commands in there that are definitely simulator only. I'd fire up wireshark and see if you can see the traffic. – Andy Davies Feb 07 '13 at 14:08
0

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.

Andre Zimpel
  • 2,323
  • 4
  • 27
  • 42