如何将PhoneGap调试控制台与CLI集成? [英] How do I integrate the PhoneGap debug console with CLI?

查看:181
本文介绍了如何将PhoneGap调试控制台与CLI集成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PhoneGap网站上的此页面 http:// docs .phonegap.com / en / 3.3.0 / guide_cli_index.md.html#%20Command-Line%20Interface 告诉我们如何使用CLI下载调试控制台($ cordova plugin add org.apache.cordova。安慰)。但是,我看不到有关如何将其集成到HTML页面上的Cordova iOS应用程序的进一步步骤。

This page on the PhoneGap site http://docs.phonegap.com/en/3.3.0/guide_cli_index.md.html#The%20Command-Line%20Interface tells us how to use CLI to download the debug console ($ cordova plugin add org.apache.cordova.console). However, I see no further steps on how to integrate it into an Cordova iOS app on an HTML page.

Cordova仿真期间在终端窗口中显示的控制台信息在哪里?在Xcode控制台?

Where is the console information supposed to appear, in the Terminal window during a cordova emulate? In the Xcode console?

我需要向config.xml中添加任何内容吗?

Do I need to add anything to config.xml?

推荐答案

为了其他人的利益,这里有插件的详细说明。

For the benefit of others who come to this page, here are detailed instructions for the plugin.

安装和使用PhoneGap / Cordova调试控制台插件

Installing and using the PhoneGap/Cordova debug console plugin

作为调试过程的一部分,您可能想要输出自己的消息控制台在执行某些代码时。 http:// docs上的CLI页面.phonegap.com / en / 3.3.0 / guide_cli_index.md.html#%20命令行%20接口告诉调试控制台下载。

As part of your debugging process, you may want to output your own messages in the console when certain code has been executed. The CLI page at http://docs.phonegap.com/en/3.3.0/guide_cli_index.md.html#The%20Command-Line%20Interface tells of a debug console download.


  1. 导航到项目的主目录并输入终端:
    cordova插件添加org.apache.cordova.console

在index.html档案中新增console.log:

Add a console.log line in your index.html file:

function onDeviceReady(){
console.log(*** Device is ready!***);
}

现在让我们在Xcode中查看控制台消息。每当您在Xcode中运行应用程序时,首先输入:
cordova prepare

Now let's view the console message in Xcode. Whenever you'll be running the app in Xcode, first type: cordova prepare

在Xcode中打开应用程序,然后执行Product> Clean。

Open the app in Xcode and do Product > Clean.

如果在Xcode中看不到控制台,请单击View> Debug Area> Activate Console。

If you can't see the console in Xcode, then View > Debug Area > Activate Console.

在Xcode中运行应用程序,并在Xcode的控制台中看到您的控制台消息。

Run the app in Xcode and watch your console message appear in Xcode's console.

这篇关于如何将PhoneGap调试控制台与CLI集成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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