Created
March 2, 2012 21:47
-
-
Save sergiolopes/1961630 to your computer and use it in GitHub Desktop.
Runs iOS 5 simulator with MobileSafari remote debug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Open iPhone Simulator on default location for XCode 4.3 | |
open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app | |
# Open mobile safari | |
echo Open mobile safari on emulator and press return | |
read | |
# Plug debug to MobileSafari.app | |
echo Debugging | |
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." | |
exit | |
else | |
cat <<EOM | gdb -quiet > /dev/null | |
attach $MobileSafari_PID | |
p (void *)[WebView _enableRemoteInspector] | |
detach | |
EOM | |
fi | |
# Open debugger in Safari.app | |
open -a /Applications/Safari.app http://localhost:9999 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Debugging
Unable to find Mach task port for process-id 78007: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))
A syntax error in expression, near `[WebView _enableRemoteInspector]'.