终端下输入:vi .bash_profile 编辑环境变量:
1
2
3
4
5
6
7
8
9
10
11
|
export COCOS_CONSOLE_ROOT=/Users/jia*/Cocos2d-x/cocos2d-x-3.2/cocos2d-x-3.2/tools/cocos2d-console/bin export PATH=$COCOS_CONSOLE_ROOT:$PATH export NDK_ROOT=/Users/jia*/Cocos2d-x/PackageAndroid/ndk export PATH=$NDK_ROOT:$PATH export ANDROID_SDK_ROOT=/Users/jia*/Cocos2d-x/PackageAndroid/sdk export PATH=$ANDROID_SDK_ROOT:$PATH export ANT_ROOT=/Users/jia*/Cocos2d-x/PackageAndroid/ant/bin export PATH=$ANT_ROOT:$PATH |
输入:source .bash_profile 使刚才输入的环境变量生效!
查看ant 是否安装:ant -version
若成功,则会显示版本:
1
|
Apache Ant(TM) version 1.9.4 compiled on April 29 2014 |
查看java是否安装: java -version
若成功,则会显示版本:
1
|
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) |