RandyMcMillan/cordova-ios — comment on commit ae48515c8d6a40af70f5fa215b844e3ce0f4e6f5
File:  line 0
By RandyMcMillan:

It can be placed in the project build scripts:

////////

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 < /dev/null
attach $MobileSafari_PID
p (void *)[WebView _enableRemoteInspector]
detach
EOM

fi

////////

The script above may be repurposed to fit within the phonegap/cordova project environment and may give a hint on how to add it to the project template (Build Phases > run Script) and not directly to the AppDelegate.m