Skip to content

Instantly share code, notes, and snippets.

@sousk
Created January 31, 2012 06:43
Show Gist options
  • Save sousk/1709269 to your computer and use it in GitHub Desktop.
Save sousk/1709269 to your computer and use it in GitHub Desktop.
MobileSafari_PID=$(ps x | grep "MobileSafari" | grep -v grep | awk '{ print $1 }')
if [ "$MobileSafari_PID" == "" ]; then
echo "Mobile Safari.app must be running in the Simulator to enable the remote inspector."
else
cat <<EOM | gdb -quiet > /dev/null
attach $MobileSafari_PID
p (void *)[WebView _enableRemoteInspector]
detach
EOM
open -a Safari "http://localhost:9999/"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment