PhoneGap的/科尔多瓦在Mac上添加的Andr​​oid平台不被识别为核心的科尔多瓦平台 [英] Phonegap/cordova add Android Platform on Mac not recognized as core cordova platform

查看:186
本文介绍了PhoneGap的/科尔多瓦在Mac上添加的Andr​​oid平台不被识别为核心的科尔多瓦平台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个建立在Mac OS的Andr​​oid项目的问题。
用命令:

I have an issue with setting up an Android Project on Mac OS. with the command:

$cordova platform add /path/to/androidSDK/android

我已经得到了错误消息:

I've got the error message:

[Error: Platform "/path/to/androidSDK/android" not recognized as core cordova platform.]

有没有人有同样的问题?我该如何解决呢?

Does anyone have the same Issue ? How can I fix that ?

最新的Andr​​oid SDK版本(下载今天)。

latest Android SDK version (downloaded today).

PhoneGap的版本:3.1.0-0.15.0

Phonegap version: 3.1.0-0.15.0

OSX 10.9小牛

OSX 10.9 Mavericks

推荐答案

要安装科尔多瓦命令行工具,请按照下列步骤操作:

To install the cordova command-line tool, follow these steps:

首先经过<一个href=\"http://cordova.apache.org/docs/en/3.1.0/guide_platforms_android_index.md.html#Android%20Platform%20Guide\">Cordova文件

有关科尔多瓦命令行工具工作,你需要包括SDK的工具和平台工具目录在PATH环境。在Mac上,你可以用文本编辑器来创建或修改〜/ .bash_profile中的文件,添加一行,如以下,具体情况取决于SDK安装:

For Cordova command-line tools to work, you need to include the SDK's tools and platform-tools directories in your PATH environment. On Mac, you can use a text editor to create or modify the ~/.bash_profile file, adding a line such as the following, depending on where the SDK installs:

export PATH=${PATH}:/Development/adt-bundle/sdk/platform-tools:/Development/adt-bundle/sdk/tools

下一步:

下载和安装的的Node.js从这里 。安装之后,你应该能够调用节点或NPM在命令行上。

Download and install Node.js from Here. Following installation, you should be able to invoke node or npm on your command line.

安装科尔多瓦工具。在Unix(苹果机),prefixing附加sudo命令可能有必要另有限制的目录来安装开发工具:

Install the cordova utility. In Unix(Mac), prefixing the additional sudo command may be necessary to install development utilities in otherwise restricted directories:

 For Mac $ sudo npm install -g cordova

在科尔多瓦的成功安装完成后,现在你可以创建应用程序

once successful installation of cordova is done ,now you can create your application

在所有的平台。

创建科尔多瓦应用

转到您维护您的源$ C ​​$ c中的目录,然后运行一个命令,如以下内容:

Go to the directory where you maintain your source code, and run a command such as the following:

    $cordova create hello com.example.hello CordovaDemo

你好是要在其中创建应用程序的目录

hello is the directory where you want to create your application

输入com.example.hello 是包名

CordovaDemo 是应用程序的名称

你的项目一旦成功创建,某些文件将在目录中创建即招呼

Once Successful creation of your project, some file will be created inside the directory i.e hello

添加平台

所有的后续命令需要在项目目录中运行,或在其范围内的任何子目录:

All subsequent commands need to be run within the project's directory, or any subdirectories within its scope:

  $ cd hello

现在你需要指定用于Mac的一组目标平台,支持的操作系统

Now you need to specify a set of target platforms, Supported OS for Mac

$ cordova platform add android

PLZ告诉我,如果你仍然有问题。

plz tell me if you are still having problem.

希望这会帮助你。

这篇关于PhoneGap的/科尔多瓦在Mac上添加的Andr​​oid平台不被识别为核心的科尔多瓦平台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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