title: Is it possible to connect to Mobile Safari remote debugger protocol using python?
body: <p>I have an HTML5-based application running on iOS and I want to connect to it using the webkit remote debugger protocol <a href="http://www.webkit.org/blog/1620/webkit-remote-debugging/" rel="nofollow">1</a> that is now supported in iOS 5 <a href="http://atnan.com/blog/2011/11/17/enabling-remote-debugging-via-private-apis-in-mobile-safari/" rel="nofollow">2</a>.</p>
  
  <p>I am trying to track down a problem where my javascript application is hard crashing the browser (SEG_FAULT).  I would like to get a trace of the application as it executes so I can see what line(s) or network operations may be leading to the issue.  My current idea is to write a python application that will connect to the remote debugger and keep stepping through the code and collecting information to a log file while I interact with the application.</p>
  
  <p>I ran into an initial hurdle though that I can't find any examples or documentation about how to connect to the debugger and communicate or even if it is possible.</p>
  
  <p>Does anyone know if this is possible and if so can you point me at some documentation and/or example code?</p>
  
  <hr>
  
  <p>Based on the code from also below I created a project on github to test out some of the ideas.  You can find it here: <a href="https://github.com/abierbaum/python_webkit_remote_debugger" rel="nofollow">abierbaum:/python_webkit-remote_debugger</a></p>