Search code examples
csssafariionic-frameworkios-simulatorsafari-web-inspector

Equivalent to right-click 'inspect element' in iOS simulator Safari?


When developing a web app using ionic, it is very useful to run up the program in iOS simulator with the command line

ionic run ios -l -c -s --target="iPhone-5s"

Then by selecting desktop Safari and Develop -> iOS Simulator you can bring up the Web Inspector for the app on the simulator. All well and good.

On desktop Safari, it is very useful to right-click on an element to find it in the Web Inspector. Is there a way to do this in iOS Simulator Safari ?

I end up putting a searchable string into the HTML and Ctrl-F to find it which is more cumbersome.


Solution

  • There is a target button in the web inspector window that can select an element inside the iOS Simulator. Here's a screenshot:

    "Select Element" button in Web Inspector