Safari Remote Debug Tool
This tutorial will show you how to remotely debug your cordova app on iOS using the safari remote debug tool to inspect the java script errors .
Enable Debugging on Desktop side
First, you need to enable Safari Develop menu in Safari desktop.
Go to Safari > Preferences and ensure the Show Develop menu in menu bar check box is checked.
Enable Debug Mode on Mobile
Now, you need to enable Web Inspector in the advanced Safari Settings of your iOS Device. Go to Settings > Safari > Advanced and enable Web Inspector.Inspect with Safari
Now we're finally able to remotely debug our cordova webview with Safari. First, launch your app on your iOS device connected to the computer via USB.
In Safari desktop, Go to Develop > Your iPad/iPhone > Index.html.
That's it! Now you should be able to debug your app like any other website!
Debug JavaScript Step by Step
Exactly like you would do on any website, you can remotely debug step by step your JavaScript code in the Safari Web Inspector.