我刚刚第一次安装Phonegap,浏览了一下文档。让我困惑的是,一些文档使用命令“phonegap”和一些“cordova”。
Android平台指南:
$ cordova create hello com.example.hello "HelloWorld"
命令行接口指南告诉:
$ phonegap create hello com.example.hello HelloWorld
这两个命令之间是否存在差异(导致不同的文件和文件夹结构),或者它们只是同一事物的别名?
我刚刚第一次安装Phonegap,浏览了一下文档。让我困惑的是,一些文档使用命令“phonegap”和一些“cordova”。
Android平台指南:
$ cordova create hello com.example.hello "HelloWorld"
命令行接口指南告诉:
$ phonegap create hello com.example.hello HelloWorld
这两个命令之间是否存在差异(导致不同的文件和文件夹结构),或者它们只是同一事物的别名?
当前回答
上面,Abhishek提到了两个url中指定的命令行差异:
PhoneGap: http://docs.phonegap.com/en/edge/guide_cli_index.md.html 科尔多瓦: http://cordova.apache.org/docs/en/3.0.0/guide_cli_index.md.html#The%20Command-line%20Interface
需要指出的一件事是,在这篇文章中,phonegap看起来几乎和cordova一样,并且可能不是命令行选项差异的准确图像。因此,我将两者都安装到我的系统中,以便查看它们之间的区别。
这些只是其中的一部分。希望有一天他们能更加同步。如果有人有更好的消息,请告诉我。
Adding platforms seems to be done differently between the two commands ( phonegap uses "install" command, cordova uses "platform add" command ) Adding/creating projects seems to be the same between the two commands ( same command line options supported ) Obviously, as has been stated, phonegap can use PhoneGap Build, so it has the corresponding options to trigger that or local builds Quite a few other significant command line differences, simply by running "cordova help" and "phonegap help" and comparing the two.
我想我的观点是,phonegap CLI文档经常提到的并不是针对phonegap CLI,而是针对cordova CLI。如果我遗漏了什么,请告诉我。谢谢。
其他回答
它们都是相同的,除了phonegap cli可以帮助你在phonegap build上构建应用程序。 如果你不使用PhoneGap构建服务,我的建议是使用cordova CLI。
This first choice might be a confusing one but it’s really very simple. PhoneGap is a product owned by Adobe which currently includes additional build services, and it may or may not eventually offer additional services and/or charge payments for use in the future. Cordova is owned and maintained by Apache, and will always be maintained as an open source project. Currently they both have a very similar API. I would recommend going with Cordova, unless you require the additional PhoneGap build services.
http://phonegap.com/blog/2012/03/19/phonegap-cordova-and-whate28099s-in-a-name/
我想这个网址说明了你需要什么。 Phonegap是建立在Apache Cordova上的。你可以把Apache Cordova看作是PhoneGap的引擎。随着时间的推移,PhoneGap发行版可能包含额外的工具,这就是为什么它们在命令上有所不同,但它们做的是同样的事情。
编辑:额外的信息添加为它的命令差异,phonegap可以做什么,而apache cordova不能,反之亦然
PhoneGap的第一个命令行选项
http://docs.phonegap.com/en/edge/guide_cli_index.md.html
Apache Cordova选项 http://cordova.apache.org/docs/en/3.0.0/guide_cli_index.md.html#The%20Command-line%20Interface
As almost most of commands are similar. There are few differences (Note: No difference in Codebase) Adobe can add additional features to PhoneGap so that will not be in Cordova ,Eg: Building applications remotely for that you need to have account on https://build.phonegap.com Though For local builds phonegap cli uses cordova cli (Link to check: https://github.com/phonegap/phonegap-cli/blob/master/lib/phonegap/util/platform.js) Platform Environment Names. Mapping: 'local' => cordova-cli 'remote' => PhoneGap/Build
也来自以下存储库: 需要cordova的模块有:
build
create
install
local install
local plugin add , list , remove
run
mode
platform update
run
不包括科尔多瓦:
remote build
remote install
remote login,logout
remote run
serve
以下是我发现的不同之处:
我将phonegap 3.3.0-0.18.0 CLI与cordova 3.3.0文档中描述的该CLI的功能进行比较。
“ls”是“cordova plugin”的选项,但不是“phonegap plugin”的选项。你必须用“list”代替。 例如:“phonegap插件列表” "serve"在"phonegap -help"中没有记录,但它确实存在,而且它确实有效。它不会找到和加载phonegap.js,所以页面永远不会完全加载,但它仍然提供了一些价值。我不确定这和科多瓦的行为是否不同。 “phonegap平台添加”在phonegap中不工作。您必须执行“phonegap构建”以添加对平台的支持。
注意,在phonegap中,建议的解决方案是使用cordova命令,您可能还会遇到一些令人困惑的错误消息。
从我所读到的(如果我错了,请纠正我):
Phonegap声称他们开始尝试做这个,但没有成功,所以他们把它交给了Apache软件基金会。
Apache用他们的厉害(Long live Apache)修复了它,开发了它,并使它变得非常棒。
现在Phonegap正试图维护和增强他们收回的副本,但仍在不断地填充它。
所以,在我看来,我想要的是一个可靠的、值得信赖的开发平台,由我可以信任的经验丰富的专业人士制作,而不是一个打补丁的子版本。所以我说我是Cordova的开发者而不是Phonegap的开发者。
Iv还读到,在第二次绝望的尝试中,Phonegap获得了人气,并控制了Apache的伟大作品,现在已经在Adobe的旗帜下出售。你知道Adobe,他们不做任何免费的事情,而且在维护软件生命周期方面非常糟糕,以至于他们的应用程序需要在你每次眨眼的时候执行更新,而且由于某种原因,他们的每个应用程序都是你预期的100倍大。
如果我没看错的话,我想这就是我的研究总结。
如果是真的,那就让我们放弃Phonegap的胡言乱语,继续留在科尔多瓦。