Skip to content

Debugging iOS with Safari

Safari provides a powerful set of developer tools that can be used to debug and analyze web applications running on iOS devices.

(On physical devices only, not needed for simulator)

  1. Enable Safari Developer Mode: On your iOS device, open the "Settings" app, navigate to "Safari", and enable "Advanced" settings. Then, toggle on the "Web Inspector" option.

  2. Connect Your iOS Device to Your Mac: Connect your iOS device to your Mac using a USB cable.

  3. Open Safari on Your Mac: Launch Safari on your Mac.

  4. Enable Developer Tools in Safari: In the Safari menu, go to "Preferences", click on the "Advanced" tab, and check the "Show Develop menu in menu bar" option.

  5. Enable Remote Debugging on Your iOS Device: On your iOS device, open Safari, navigate to the web application you want to debug, and ensure it is running.

  6. Inspect the Web Application: In Safari on your Mac, click on the "Develop" menu in the menu bar and select your iOS device. You should see a list of Safari tabs and web applications running on the device.

  7. Choose the Web Application to Debug: From the list of running web applications, select the one you want to debug. This will open a new Safari developer tools window, specifically for that web application.

  8. Use Safari Developer Tools: In the Safari developer tools window, you can access various panels, such as Elements, Network, Console, and more. These panels provide features like inspecting and modifying the DOM, analyzing network requests, logging JavaScript console messages, and debugging JavaScript code.