iOS Safari debugging
This tutorial guides you through debugging Safari on an iOS device with WebDebugX. You will learn how to connect an iOS device, debug pages in Safari, analyze performance problems, and work around the common debugging pitfalls.
Before you start
Section titled “Before you start”Before debugging iOS Safari, make sure you have:
- The latest version of WebDebugX installed
- The iOS device you want to debug (iPhone or iPad) at hand
- The device and computer on the same network (if you are using WiFi debugging)
- Safari’s Web Inspector enabled on the iOS device
Tip: for iOS Safari debugging you must enable Web Inspector on the device. You will find the option under Settings > Safari > Advanced — see How to enable Web Inspector.
Connect the device
Section titled “Connect the device”- Connect the iOS device to the computer with a USB cable
- Trust the computer on the iOS device (if prompted)
- Launch WebDebugX
- WebDebugX detects your iOS device automatically
Select a Safari tab
Section titled “Select a Safari tab”Once the device is connected, pick the Safari tab you want to debug:
- In the WebDebugX device list, click your iOS device
- On the device detail page you will see Safari and the list of tabs it has open
- Select the tab you want to debug
- Click Start debugging
Tip: if you cannot see any Safari tabs, make sure Safari is open on the device and at least one tab has a page loaded.
Debugging Safari content
Section titled “Debugging Safari content”Once a tab is selected, the following tools are available.
Inspect page elements
Section titled “Inspect page elements”View and modify the HTML elements on the page:
- In the debugging interface, click the Elements tab
- You will see the full DOM tree of the page
- Click an element to view its attributes and styles
- Right-click an element to edit, delete or add elements
- Use the Select element tool (the arrow icon at the top left) to pick elements directly on the page
Debug JavaScript
Section titled “Debug JavaScript”Run and debug JavaScript in Safari:
- Click the Console tab
- Execute JavaScript in the console
- View JavaScript errors and logs
- Use
console.log(),console.error()and similar methods to output debugging information
Monitor network requests
Section titled “Monitor network requests”Analyze the requests the page makes:
- Click the Network tab
- You will see every network request
- Click a request to view details, including request headers, response headers and response content
- Use filters to narrow down specific types of requests
- Enable Preserve log to keep request records across page navigations
Debug JavaScript sources
Section titled “Debug JavaScript sources”Set breakpoints and step through code:
- Click the Sources tab
- Find the JavaScript file you want to debug in the file tree
- Click a line number to add a breakpoint
- When execution reaches the breakpoint, inspect variable values and step through the code
- Use the Watch panel to track variable values
Device mode
Section titled “Device mode”WebDebugX offers a device mode that emulates different iOS devices:
- In the debugging interface, click the Device mode icon (the phone icon) at the top right
- Choose the device to emulate from the dropdown (iPhone 13, iPad Pro, and so on)
- You can also switch device orientation (portrait / landscape)
- Adjust the zoom level to see the page at different sizes
Tip: device mode is useful for testing responsive design — you can check how your page looks on iOS devices you do not physically own.
Performance analysis
Section titled “Performance analysis”Performance panel
Section titled “Performance panel”Analyze page load and rendering performance:
- Click the Performance tab
- Click Start recording
- Interact with the page on the iOS device
- Click Stop recording when you are done
- Analyze the timeline — CPU usage, rendering events, and so on
Memory analysis
Section titled “Memory analysis”Detect memory leaks and optimize memory usage:
- Click the Memory tab
- Choose an analysis type (heap snapshot, allocation timeline, and so on)
- Click Start recording
- Interact with the page on the iOS device
- Click Stop recording when you are done
- Analyze memory usage and look for possible leaks
Network performance
Section titled “Network performance”Optimize requests and resource loading:
- Enable Preserve log in the Network panel
- Reload the page and review every request
- Analyze load times and sizes
- Look for resources you can optimize — compress images, combine CSS / JS files, and so on
- Use network throttling to simulate different network conditions
Advanced techniques
Section titled “Advanced techniques”Simulate different network conditions
Section titled “Simulate different network conditions”- In the Network panel, open the Throttling dropdown
- Choose a preset (3G, 4G or Offline)
- Or choose Custom and set upload / download speed and latency
- Reload the page and observe the loading behaviour
Simulate geolocation
Section titled “Simulate geolocation”- In the debugging interface, click More tools (the three dots)
- Choose Sensors
- Under Geolocation, pick a preset location or enter custom coordinates
- Reload the page — it will use the simulated location
Simulate device orientation
Section titled “Simulate device orientation”- In the debugging interface, click More tools (the three dots)
- Choose Sensors
- Under Device orientation, adjust the alpha, beta and gamma values
- Or use a preset orientation (landscape left, landscape right, and so on)
- The page responds to the simulated orientation change
Save and restore a debugging session
Section titled “Save and restore a debugging session”- In the debugging interface, click File > Save session
- Enter a session name and pick a location
- Later, restore it via File > Open session
- This is particularly useful for long debugging runs or team collaboration
Troubleshooting
Section titled “Troubleshooting”The device does not appear in WebDebugX
Section titled “The device does not appear in WebDebugX”- Make sure Web Inspector is enabled on the iOS device
- Check that the USB connection is working
- Try a different USB port or cable
- Restart WebDebugX and the iOS device
For a fuller checklist, see Device not found.
Safari tabs do not appear
Section titled “Safari tabs do not appear”- Make sure Safari is open on the iOS device
- Check that Web Inspector is enabled
- Try closing and reopening Safari
- Restart WebDebugX
The debugging interface is unresponsive
Section titled “The debugging interface is unresponsive”- Check that the network connection is stable
- Try reconnecting the device
- Close and reopen the debugging session
- If the problem persists, restart WebDebugX