Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 31 lines (25 sloc) 843 Bytes
#!/bin/sh
#
# Configure Mobile Safari on the Simulator allow remote debugging of web pages
# and open safari to view the inspector.
#
# If you want to open the Simulator from the command line you might like the
# following alias:
# alias iphone-simulator="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
You can’t perform that action at this time.