How to see the javascript errors of PhoneGap app in Xcode?

后端 未结 10 1238
轮回少年
轮回少年 2020-12-04 15:12

I want to debug my PhoneGap app in Xcode, but its Console can not show javascript errors.

10条回答
  •  暖寄归人
    2020-12-04 15:52

    Note that with 0.9.2 (released today), console.log has been standardized across the platforms for logging (with debug.log deprecated).

    There is a function that is available on the desktop WebView that is not exposed in the iOS UIWebView that will catch all errors (I'm trying to hack that functionality into a plugin, which uses private APIs, but the plugin would only be for development), but for now do what Kris suggested above and put try catch blocks on code and use console.log

    To quickly catch possible syntax errors, when developing I have the page loaded in desktop Safari and quickly refresh it with the webkit error console viewable.

提交回复
热议问题