How to watch console.logs in ionic emulator?

前端 未结 6 1017
别那么骄傲
别那么骄傲 2021-02-01 14:33

I\'m building an app using the Ionic framework, which I\'ve done in the browser until now. Because I now want to use the cordovaOauth plugin I need to use the emulator. The prob

6条回答
  •  北荒
    北荒 (楼主)
    2021-02-01 15:01

    There are a few ways to debug your ionic app.

    • In the browser you can catch the errors in the console.
    • If you are emulating your app on a simulator or a mobile device you can install the cordova plugin that displays js errors in the xcode console. So you can emulate your device and catch errors on xcode.

    Here is how you add the plugin:

    cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git

    Hope this helps! It came in very handy for me while I was debugging GeoFire errors and testing the cordova camera and geolocation api.

提交回复
热议问题