I used to use the "Debug Console" for mobile Safari to print out console.log messages when I'm troubleshooting. With iOS 6, in Safari's advanced settings, the "Web Inspector" replaced the "Debug Console." Unfortunately, my company doesn't allow me to plug the phones we're testing with into the computers we're developing on.
Does anyone know how to enable messages printed by using console.log() to be show on iPhones with iOS 6?
Here's how: Open the iPhone Settings menu. On an iPhone with an early version of iOS, access the Debug Console through Settings > Safari > Developer > Debug Console. When Safari on the iPhone detects CSS, HTML, and JavaScript errors, details of each display in the debugger.
Apple Safari To do that, go into Safari's preferences (Safari Menu > Preferences) and select the Advanced Tab. Once that menu is enabled, you will find the developer console by clicking on Develop > Show Javascript Console. You can also use the shortcut Option + ⌘ + C .
I have found it helpful to output any JS errors with an alert on window.onerror ->
window.onerror = function(error) { alert(error); };
I paste that into the top of scripts so that any runtime errors will be output in a native alert. Works on desktop too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With