科尔多瓦和Android的设置使用命令行 [英] Cordova and setting Android using command line

查看:211
本文介绍了科尔多瓦和Android的设置使用命令行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图转移我从科尔多瓦2.1到最新的现有项目,3.1至极可以installev通过命令行,

I am trying to migrate my existing project from cordova 2.1 to the latest, 3.1 wich can be installev vía command line,

我已经安装了Android SDK,

I already have the Android SDK installed,

所以:

sudo npm install -g cordova // All good
cordova create hello com.example.hello HelloWorld // All good
cordova platform add android // Then it fires:

Checking Android requirements...
[Error: The command `android` failed. Make sure you have the latest Android SDK installed, and the `android` command (inside the tools/ folder) added to your path. Output: ]

因此​​,我安装的MacPorts和尝试:

So I installed Macports and tried:

sudo port install android

至极日志:

Warning: All compilers are either blacklisted or unavailable; defaulting to first fallback option
Warning: Xcode does not appear to be installed; most ports will likely fail to build.
--->  Cleaning android
--->  Scanning binaries for linking errors: 100.0%
--->  No broken files found.

知不知道我在这里丢失?

Any idea what am I missing here?

推荐答案

这是工作科尔多瓦的Andr​​oid的MAC十亿%。我打的解决方案,现在我正在尝试这种 @Toni米歇尔Caubet 。我会高兴与大家分享我的答案。

It's work cordova Android for MAC 1000000000%. I fought solution and now i'm working try this @Toni Michel Caubet. I will happy to share my Answer.

的步骤:

打开你的终端,并随后,

Open Your Terminal and followed by,

  1. 触摸〜/ .bash_profile中

开〜/ .bash_profile中

<$c$c>PATH="/Users/System-Name/Documents/android-sdk-macosx/sdk/tools:/Development/android-sdk-macosx/sdk/platform-tools:$PATH"这是保存在我的系统,Android SDK中的位置

4.Save文件并退出文本编辑器。

4.Save the file and quit the text editor.

5.Execute你的的.bash_profile 来更新你的路径:

5.Execute your .bash_profile to update your PATH:

源〜/ .bash_profile中

如果你想看到你的环境路径:

if you want to see your environment path:

7.In终端类型:设置

7.In your terminal type: set

后,你可以看到像

8.As至于你说的很正确。就像你输入命令后的科尔多瓦平台添加的android 。你得到以下错误。因为Java SDK不会太设置环境PATH。

8.As far as your made it very correct. After your enter command like cordova platform add android. you get following error. because Java SDK doesn't too set environment PATH.

9。开〜/ .bash_profile中。添加JAVA_HOME值

9.open ~/.bash_profile. Add JAVA_HOME value

10.你可以看到你的环境下,如STEP 7 设置。你应该可以看到:

10.You can see your environment like STEP 7 set. You should be able see:

11.Successfully创造环境,现在你可以创建科尔多瓦和PhoneGap的Andr​​oid项目

11.Successfully created environment now you can create Android project with Cordova or PhoneGap

这篇关于科尔多瓦和Android的设置使用命令行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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