我正在使用Ionic框架构建应用程序,到目前为止,我已经在浏览器中完成了该操作。因为我现在想使用cordovaOauth插件,所以我需要使用模拟器。问题是我无法在模拟器中看到任何console.log(),就像在浏览器中一样,这使得调试变得很困难。
有人知道如何在Ionic / Cordova中使用模拟器中的控制台日志记录吗?欢迎所有提示!
只需在仿真器中启用控制台日志即可。这是我的例子:
> 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
consolelogs
在命令行中键入,然后按Enter。
consolelogs
Console log output: enabled
Loading: /?restart=382451
ionic $ 0 498458 log Hi there! This is from console.log
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句