Debug Ionic app on IOS?

后端 未结 5 570
予麋鹿
予麋鹿 2020-12-04 16:22

My HTML5 app is packaged by Ionic (using Cordova) and loads onto my iPhone like a normal app.

Can I debug whilst connected to the device? I know with Android you hav

相关标签:
5条回答
  • 2020-12-04 17:08

    There are three primary options.

    1. Debug using Safari. This is good for debugging a hybrid app, but cannot tell you output related to native plugins. http://webdesign.tutsplus.com/articles/quick-tip-using-web-inspector-to-debug-mobile-safari--webdesign-8787
    2. Open the project and build to device in Xcode. This shows the output of the entire device http://cordova.apache.org/docs/en/3.5.0/guide_platforms_ios_index.md.html#iOS%20Platform%20Guide
    3. Debug with Ionic CLI. Using ionic run ios -l -c -s with the flags will use live reload and print the logs to the console. http://ionicframework.com/blog/live-reload-all-things-ionic-cli/
    0 讨论(0)
  • 2020-12-04 17:18

    You can use Visual Studio Code with the following extension: https://marketplace.visualstudio.com/items?itemName=vsmobile.cordova-tools

    Regards, Nicholls

    0 讨论(0)
  • 2020-12-04 17:18

    I'd also add that in Ionic 1.2, you can get console/error output right in Terminal via ionic serve or ionic emulate.

    0 讨论(0)
  • 2020-12-04 17:19

    Similar to the first answer, here's how I debug on iOS.

    ionic emulate ios -lc
    

    Which runs app using simulator and outputs console logs and errors to terminal with live reloading.

    0 讨论(0)
  • 2020-12-04 17:23

    i'm using ionic 2 and typescript. you can use debugger keyword to debug on ios like this:

    then open safari -> developer -> simulate -> index.html, good luck

    0 讨论(0)
提交回复
热议问题