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

后端 未结 10 1237
轮回少年
轮回少年 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:29

    Here's a simple way that worked for me:

    • cd to the directory containing your index.html file in the terminal
    • Start a http server using python by invoking (I used python 2.7):

      python -m SimpleHTTPServer

    • View the page in safari by entering the address of the HTTPServer in a browser, for me the URL was:

      http://0.0.0.0:8000/
      
    • Open developer tools:

      In chrome this is alt+command+i. View the console tab, may need to refresh the page.

      In Safari: Safari --> Preferences --> Advanced --> check "Show Develop Menu". Develop menu --> Show error console (or alt+command+c). Refresh the page. Hitting CTRL+5 opens the issues tab.

提交回复
热议问题