Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save billmeyer/fc93d20bf0b59626f555e521d137a91e to your computer and use it in GitHub Desktop.
Save billmeyer/fc93d20bf0b59626f555e521d137a91e to your computer and use it in GitHub Desktop.
Opening the Web Inspector to Debug Applications in the iOS Simulator/Mobile Safari
  1. Launch a manual session with the iOS simulator of your choice.
  2. In the manual session, open Safari (desktop). To do this:
  3. Click outside the simulator, activating Finder.
  4. Select File in the menu → New Finder Window.
  5. Select ApplicationsSafari and open it.
  6. Check to see if Develop is in the menu for Safari. If it isn't:
  • Select SafariPreferences.
  • Go to the Advanced tab, and check the box at the bottom to turn ON the develop menu.
  • Check to see if the web inspector is active for the iOS Simulator (it should be enabled by default):
  • Select Settings (for iOS Simulator) → SafariAdvanced (scroll to the bottom of the settings page) &arr; Turn on web inspector.
  1. Select iOS Simulator —> Quit iOS Simulator. (Important)
  2. Re-launch the iOS Simulator. (This can usually be done from the Apple menu —> Recent Items)
  3. Open your webpage or web app in the iOS Simulator.
  4. In Safari, select Develop —> iOS Simulator —> yourpage.html

You should now see the same developer tools as though you were in Safari itself.

The reason the simulator needs to be relaunched is related to the debugging connection. Appium owns the connection at the start of the test, which prevents Safari from using it – this is why the webpage will appear grayed out if the simulator is not re-launched . When the simulator is re-launched, Appium no longer controls the connection, allowing Safari to connect to the debugger and select the webpage as expected.

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