Skip to content

Instantly share code, notes, and snippets.

@pmeinhardt
Created April 27, 2012 10:16
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmeinhardt/2508183 to your computer and use it in GitHub Desktop.
Save pmeinhardt/2508183 to your computer and use it in GitHub Desktop.
web-inspect mobile safari running in the ios simulator
#!/bin/bash
# Based on Nathan de Vries' findings http://goo.gl/jbtzX
MSPID=$(ps x | grep "MobileSafari" | grep -v grep | awk '{ print $1 }')
if [ -z "$MSPID" ]; then
echo "Run \"Mobile Safari.app\" in the Simulater to enable remove debugging."
exit 1
fi
cat <<EOM | gdb -quiet > /dev/null
attach $MSPID
p (void *)[WebView _enableRemoteInspector]
detach
EOM
open -a Safari http://localhost:9999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment