Xamarin ios webview debugging

Rob Ward 1 Reputation point
2022-06-21T15:15:35.2+00:00

Have a Xamarin app that is just a webview to a website. In ios app the website isn't loading, guessing a javascript error... But how can I see/log this error? App works just fine in android and in desktop browsers.

Developer technologies .NET Xamarin
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 36,436 Reputation points Microsoft External Staff
    2022-06-22T06:22:25.307+00:00

    Hello @Rob Ward ,

    First, you need to enable Show Develop menu under Safari-> Preferences->Advanced in your MAC.

    Second, you need to enable Web Inspector on iOS device.
    If you debug on your real device, try to open the Settings app on your device, then go to Safari > Advanced, switch on the Web Inspector and JavaScript. If you are debugging on iOS simulator, there is only a JavaScript option, try to open it.

    Then your device will appear in the Develop menu of Safari , you can build and run the app. And debug the webview such as checking the source code, adding a JavaScript breakpoint and so on.

    For more details, you can refer to Safari Web Inspector Guide and Safari Developer Help.

    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.