Skip to content

Instantly share code, notes, and snippets.

@amuino
Last active April 29, 2017 06:47
Show Gist options
  • Save amuino/5649177 to your computer and use it in GitHub Desktop.
Save amuino/5649177 to your computer and use it in GitHub Desktop.
AppleScript to hook up Safari web inspector to a connected iOS device or Emulator
# Customize and Export as Application
set device_name to "My iPhone"
tell application "Safari"
activate
tell application "System Events"
click menu item "index.html" of menu device_name of menu item device_name of menu "Develop" of menu bar item "Develop" of menu bar 1 of application process "Safari"
end tell
end tell
@amuino
Copy link
Author

amuino commented May 25, 2013

Safari, or a PhoneGap application (or anything that has a webview, as long as you have a matching profile) needs to be open on the iPhone, and be a recent iOS version.

And having the web inspector enabled on the device: https://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/DebuggingSafarioniPhoneContent/DebuggingSafarioniPhoneContent.html

@Thinkscape
Copy link

I've enhanced it a little bit: https://gist.github.com/Thinkscape/8538321

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment