科尔多瓦/ PhoneGap的没有让Android目录科尔、多瓦、目录、PhoneGap

2023-09-04 09:00:06 作者:長得丑照様傲

蚂蚁,JAVA,Node.js的,PhoneGap的,和我的土坯帐户都设置正确。该getting入门指南说我应该能够类型:

ant, java, node.js, phonegap, and my adobe account are all setup properly. The getting started guide says I should be able to type:

cordova create hello com.example.hello "HelloWorld"

要创建的PhoneGap项目。这并不工作,但下面的these指令和这样做的:

to create a phonegap project. This does not work but following these instructions and doing:

phonegap build android

并最终获得了我的apk文件。但入门指南告诉我打开Eclipse和导航到我的项目的目录,然后将子目录/机器人。但是当你做/ Android不获取创建的PhoneGap构建Android ,所以我什么都没有的工作。

does eventually get me a .apk file. But the getting started guide tells me to open eclipse and navigate to the directory of my project and then set the subdirectory as /android. but /android does not get created when you do phonegap build android so I have nothing to work with.

我如何获得PhoneGap的创造了Android目录?我想完成的走捷径的入门指南代替。

How do I get phonegap to create the android directory? I am trying to finish the getting started guide instead of taking shortcuts.

推荐答案

它似乎像你正在使用的PhoneGap 3.0和此版本,不需要蚀(仅当你想使用它的编码 - 相比,PhoneGap的1.0 -2.x其中蚀来编译该应用,最新的版本它不再是一个要求)。

It does seem like you are using PhoneGap 3.0 and for this version, eclipse is not required (only if you want to use it for coding - compared to PhoneGap 1.0-2.x where eclipse was used to compiled the app, for the latest version it is no longer a requirement).

首先,你应该使用的PhoneGap 命令代替科尔多瓦命令: PhoneGap的创建Hello输入com.example.hello的HelloWorld

然后导航到 / HelloWorld的/ 文件夹

您应该看到ATLEAST这两个关键文件夹 / WWW /平台。在 / WWW 是你把你的HTML文件和codeS和 /平台/ Android版获取时产生编译使用以下命令应用程序:的PhoneGap构建Android

You should see atleast these two key folders /www and /platforms. Inside /www is where you place your HTML files and codes, and /platforms/android gets generated when you compile the app with the following command: phonegap build android.

请注意:避免让里面的任何直接更改文件/平台除了配置和清单文件。当您运行建立命令是动态生成的其他文件。所有编码应在 / WWW的地方

Note: Avoid making any direct changes to files inside /platforms except for config and manifest files. The other files are dynamically generated when you run the build command. All coding should take place within /www.

还有一件事,使用3.0.0 入门指南。

One more thing, use the 3.0.0 Getting Started guide.

---- 2014年2月更新----

随着科尔多瓦3.3.0的发布,似乎PhoneGap的团队正在试图解决的命名混乱。该单证已更新,建议使用科尔多瓦命令,而不是人。不要使用 的PhoneGap 命令了。

With the release of Cordova 3.3.0, it seems the PhoneGap team is trying to address the naming confusion. The documentations have been updated to recommend people using the cordova command instead. Do not use the phonegap command anymore.

下面是一个新鲜的安装指南保证无故障设置:

Here is a fresh installation guide for a guaranteed trouble free set up:

安装科尔多瓦(从现在开始,忘记名字了PhoneGap的)。 对于PC:

Install Cordova (forget the name PhoneGap from now on). For PC:

C:> npm install -g cordova

从命令提示符,浏览到你想使用创建项目的文件夹:

From command prompt, navigate to the folder you want to create your project using:

cordova create hello com.example.hello HelloWorld
cd HelloWorld

定义要suppport,我们就去了Android在这个例子中的操作系统:

Define the OS you want to suppport, we'll go with Android for this example:

cordova platform add android

安装插件(如果需要)。例如,我们希望以下内容:

Install plugins (If needed). For example we want the following:


cordova plugin add org.apache.cordova.device
cordova plugin add org.apache.cordova.camera
cordova plugin add org.apache.cordova.media-capture
cordova plugin add org.apache.cordova.media

cordova build android

或者直接安装应用程序来连接设备:

or to directly install the app to your connected device:

cordova run android

下面是一个链接的PhoneGap 科尔多瓦3.3.0文档 的http://docs.phonegap.com/en/3.3.0/guide_cli_index.md.html#The%20Command-Line%20Interface

Here is a link to the PhoneGapCordova 3.3.0 Documentation http://docs.phonegap.com/en/3.3.0/guide_cli_index.md.html#The%20Command-Line%20Interface