Skip to content

Instantly share code, notes, and snippets.

@neonichu
Created November 17, 2011 15:42
Show Gist options
  • Save neonichu/1373458 to your computer and use it in GitHub Desktop.
Save neonichu/1373458 to your computer and use it in GitHub Desktop.
Debug a MobileSafari instance running in the iOS 5 simulator
#!/bin/sh
##
## Debug a MobileSafari instance running in the iOS 5 simulator
##
PID=`ps axc|awk '{if ($5=="MobileSafari") print $1}'`
if [ "$PID" == "" ]
then
echo "MobileSafari is not running."
exit 1
fi
cat <<EOM | gdb -quiet > /dev/null
attach $PID
p (void *)[WebView _enableRemoteInspector]
detach
EOM
open 'http://localhost:9999'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment