网站http://www.cocos2d-x.org下载cocos2d-x
cocos2dx-3.0之前:
cd .../cocos2d-x-2.2.1/tools/project-creator
./create_project.py -project HelloWorld -package com.***.*** -language cpp
cocos2dx-3.0:
cd .../cocos2d-x-3.0alpha1/tools/project-creator
./create_project.py -p HelloWorld -k com.***.*** -l cpp
cocos2dx-3.1.1
1. pico .bash_profile
2.
export ANDROID_SDK_ROOT=/Library/android/adt-bundle-mac-x86_64-20140321/sdk
export ANDROID_NDK_ROOT=/Library/android/android-ndk-r9b
export COCOS2DX_ROOT=/Library/android/cocos2d-x-3.1.1
export NDK_ROOT=/Library/android/android-ndk-r9b
export ANT_ROOT=/Library/android/apache-ant-1.9.4/bin
export PATH=$PATH:$ANDROID_SDK_ROOT
export PATH=$PATH:$ANDROID_NDK_ROOT
export COCOS_CONSOLE_ROOT=/Library/android/cocos2d-x-3.1.1/tools/cocos2d-console/bin
export PATH=$COCOS_CONSOLE_ROOT:$PATH
保存Ctrl + x -> Y -> Enter
(source ~/.bash_profile)
3.
cocos new Cocos2DX -p com.***.*** -l cpp -d /Users/***/Documents/svn_cocos/trunk