Cordova 2.9,3.0没有console.log [英] Cordova 2.9, 3.0 no console.log

查看:148
本文介绍了Cordova 2.9,3.0没有console.log的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过全新下载的Cordova 2.9和Cordova CLI,我通过CLI创建了Hello World应用程序。我还通过CLI添加了iOS平台。查看index.js文件(在www / js中),有一个javascript对象,其中包含触发 onDeviceReady 的函数,以及其中包含控制台的函数。

With a fresh download of Cordova 2.9 and the Cordova CLI, I created Hello World application via the CLI. I also added the iOS platform via the CLI. Looking in the index.js file (within www/js), there is a javascript object which contains the function that fires onDeviceReady, and a function inside it, which contains a console.log which should output "Received Event: deviceready".

在iOS 6.1模拟器中从Xcode运行此应用程序后,没有输出从Xcode的调试控制台中的console.log。我看着cordova.js文件,注意到CLI 平台添加实用程序添加3.0(运行这个昨天,在3.0版本之前),但我试图运行应用程序与cordova- 2.9.0.js。

After running this app from Xcode in the iOS 6.1 simulator, there is no output from the console.log in Xcode's debug console. I looked at the cordova.js file and noticed the CLI platform add utility added 3.0 (ran this yesterday, before the 3.0 release), but I tried running the app with cordova-2.9.0.js as well.

无论如何,我无法在我自己的应用程序或Hello World应用程序中获得一个console.log,以显示在Xcode的控制台cordova 2.9或3.我的Xcode控制台设置为所有输出。这是发布的错误吗?从所有的谷歌我一直在做,似乎Cordova已经和不支持console.log取决于版本,我不知道它应该是现在。感谢您的帮助。

Anyway, I haven't been able to get a console.log in my own application or the Hello World app to display in Xcode's console with cordova 2.9 or 3. My Xcode console is set to All Output. Is this an error with the release? From all the googling I've been doing, it seems Cordova has had on and off support of console.log depending on the version and I don't know where it's supposed to be now. Thanks for your help.

推荐答案

控制台功能现在实现为插件,您需要手动添加到项目:

The console functionality is now implemented as a plugin, which you need to manually add to your project:

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

这篇关于Cordova 2.9,3.0没有console.log的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆