Onebite.dev

Developer tips & trick, one bite at a time

Debug javascript in iphone device

“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


🏊🏾‍♀️ Back Home