In an increasingly modern web network, the percentage of users of modern browsers and mobile devices is increasing. For our Web front-end developers, Apple mobile devices running IOS Safari are more than we can afford to ignore. However, when we need to test and debug the front-end pages, the desktop version of Safari is not exactly the same as the mobile safari (the main reason to judge in CSS device-width
), so we can only Test and debug safari directly on IOS devices.
This article focuses on a detailed approach to the front-end debugging solution for the Safari browser on IOS devices provided by Apple. The author uses the mobile Safari running on IOS 6.0.1 and the desktop version of Safari running on OS X Mountain Lion (this feature is not available in the Windows version of Safari). The mobile Safari browser on iphone, ITouch, IPad and other Apple mobile devices is theoretically feasible.
Turn on features in Settings
IOS Terminal: Set →safari→ advanced →web checker → on. ()
"OS X": safari→ preferences → advanced → display the "Development" menu in the menu bar. ()
Connecting a mobile device to a computer and enabling the debugger
After you start safari in OS X, connect to your IOS device with a USB cable and launch safari on this mobile device. By clicking "Develop" on the Safari menu on your computer, you can see the name of your IOS device, which is a submenu of all of Safari's tabs on your mobile device, and click on any one to start debugging. ()
In this debugger, we can do a variety of debugging work like the desktop OS Safari debugger, such as HTML elements, CSS and box model, such as viewing and instant editing, JavaScript debugger, page element timeline, DOM element Viewer and other functions. ()
JavaScript Instant Debugging
Same time IPhone screen
Network Request time Line
Safari frontend Development Debug IOS Perfect solution