OneBite.Dev - Coding blog in a bite size

Debug javascript in iphone device

Learn how to debug javascript of your website in iphone device from your mac to see console result error or warning

“But, It works on my computer” - said programmer That’s what we say when our code not running correctly on other machine. But now, machine is not just a computer, all smartphone including iPhone is also a machine where our code can run.

So it’s important for us to learn how to debug our website in an iPhone

How to debug website on iPhone using Web Inspector

Connect your iPhone/iPad to computer Go to setting on iPhone/iPad Choose Safari Choose “advance” Enable “Web Inspector”

Now on your Mac Go to Safari Oper Preferences, Tab Advanced Check “show Develop menu in menu bar”

Open “Develop” menu, choose your device name, with URL currently open On your mac, now you can see full consoles output, includes warning, error or info

How to debug website on iPhone directly

In your device, go to chrome://inspect Press start logging Open website you want to debug at another tab Check logs in previous tab read chromium article about this

debug javascript