编译安卓环境需要的东西

一、工具

不能用中文路径或放在中文路径下

1.这不用下载:androidsdk镜像https://dsx.bugly.qq.com/repository/1更新androidsdk4.4.2

2.ADT链接:http://pan.baidu.com/s/1c2qcGQ8密码:tvum

3.androidNDK链接:http://pan.baidu.com/s/1byEaaq密码:nuep

4.apache-ant-1.9.7-bin.ziphttp://apache.fayea.com//ant/binaries/apache-ant-1.10.1-bin.zip

5.python-2.7.11https://www.python.org/ftp/python/2.7.11/python-2.7.11-macosx10.6.pkg

6.cocos2dhttp://www.cocos.com/download

7.JavaforOSX2015-001https://support.apple.com/kb/DL1572?locale=zh_CN

9.JAVA链接:http://pan.baidu.com/s/1hr8BllE密码:4ja2

Mac下解压NDK.bin文件,转到目录下cd/Users/Dream/Documents/cocos

1.获取文件权限

chmoda+xandroid-ndk-r10e-darwin-x86_64.bin

2.解压出文件

./android-ndk-r10e-darwin-x86_64.bin

二、环境安装

1.安装Python2.7.5或者更高版本。打开终端并输入命令python。

如果已经安装了的话,会有下面的信息出来:

====================================================================

Python2.7.6(default,Sep92014,15:04:36)

[GCC4.2.1CompatibleAppleLLVM6.0(clang-600.0.39)]ondarwin

Type"help","copyright","credits"or"license"formoreinformation.

====================================================================

注:查完Python的版本后,你可以跑exit()退出Python

2.首先打开终端并定位到Cocos2dx所在的目录,如:cd/Users/Dream/Documents/cocos2d-x-3.6跑一下命令./setup.py会提示你设置变量。

/Users/wangchao/Desktop/cocos/android-ndk-r10e

/Users/wangchao/Desktop/cocos/adt-bundle-mac-x86_64-20140702/sdk

/Users/wangchao/Desktop/cocos/apache-ant-1.9.7/bin

设置好后,终端的末尾会有一条消息:

====================================================================

Pleaseexecutecommand:"source/Users/Dream/.bash_profile"tomakeaddedsystemvariablestakeeffect

====================================================================

如果执行后source/Users/wangchao/.bash_profile提示notavalididentifier则

vi~/.bash_profile

:wq保存退出

就可以了。

3.创建项目cocosnewColorBird-pcom.evanlin.colorbird-lcpp-d"/Users/wangchao/test"

4.编译项目cd/Users/wangchao/test/ColorBird/proj.android

cocoscompile-pAndroid--apandroid-20

相关推荐