Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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 problem is that I can't see any console.log() in the emulator as I do in the browser, which makes it hard to debug.

Does anybody know how in Ionic/Cordova I can make use of console logging in the emulator? All tips are welcome!

question from:https://stackoverflow.com/questions/28611375/how-to-watch-console-logs-in-ionic-emulator

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
131 views
Welcome To Ask or Share your Answers For Others

1 Answer

Just enable the console logs in the emulator. Here my example:

> ionic emulate ios --livereload

  Setup Live Reload
  Running dev server: http://localhost:8100
  Adding in default Ionic hooks
  Running live reload server: http://localhost:35729
  Watching : [ 'www/**/*', '!www/lib/**/*' ]
  Ionic server commands, enter:
    restart or r to restart the client app from the root
    goto or g and a url to have the app navigate to the given url
    consolelogs or c to enable/disable console log output
    serverlogs or s to enable/disable server log output
    quit or q to shutdown the server and exit

Type consolelogs in the command line and hit enter.

  consolelogs

  Console log output: enabled
  Loading: /?restart=382451
  ionic $ 0     498458   log      Hi there! This is from console.log

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...