Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added mobile safari inspector script

Thanks to Dan on his [blog](http://www.codecouch.com/2011/11/remote-debugging-mobile-safari-web-apps-that-have-been-added-to-the-home-screen/) for the leg work.

This version has a few refinements to make it a little more automated.
  • Loading branch information...
commit e04dddb106810ad580022cfa1bc4cc4f5fb1e749 1 parent 6120480
@csexton authored
Showing with 28 additions and 0 deletions.
  1. +28 −0 bin/mobile-safari-inspector
View
28 bin/mobile-safari-inspector
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# Configure Mobile Safari on the Simulator allow remote debugging of web pages
+# and open safari to view the inspector.
+#
+#open /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app
+
+pid=$(ps x | egrep "MobileSafari|Web.app" | grep -v grep | awk '{ print $1 }')
+
+if [ "$pid" == "" ]; then
+ echo "Safari.app must be running in the Simulator to enable the remote inspector."
+else
+
+ cat <<EOS | gdb -quiet > /dev/null
+ attach $pid
+ p (void *)[WebView _enableRemoteInspector]
+ detach
+EOS
+
+ osascript <<EOS > /dev/null 2>&1
+ tell application "Safari"
+ activate
+ do JavaScript "window.open('http://localhost:9999')" in document 1
+ end tell
+EOS
+
+
+fi
Please sign in to comment.
Something went wrong with that request. Please try again.