cocos2d-x is an open source, cross-platform game engine. It allows developers to code in C++, Lua and Javascript deployment into iOS, Android, Windows Phone, Mac OS X, Windows Desktop and Linux.
Build Requirements
Runtime Requirements
Download everything below:
After downloading everything above,
unzip Cocos2d-x
install the JDK and at the same time create a new variable called: JAVA_HOME and give it the path to where you installed the JDK above.
unzip the Android SDK and NDK to the same root location. (maybe: ~/AndroidDev)
install Python and take note of where you placed it.
extract Apache Ant and place the entire folder where you wish to keep it. Take note of where you placed it.
add the paths for Apache Ant and Python to your PATH variable.
reboot
now, test your environment before continuing. Launch a command prompt and execute:
ant
python
If everything works it is time to run setup.py to configure your Android development environment. This will set the necessary environment variables needed. If you haven't configured this environment before, you will be prompted to enter paths for variables that are not found. You run setup.py from the directory Cocos2d-x is in.
Inside your Cocos2d-x directory run:
python setup.py
caution: You must not use the ~ sign. Use the full path to your home directory. Otherwise, the scripts will fail due to error path value.
~/android-ndk-r10e
~/android-sdk-macosx
~/apache-ant-1.9.6/bin
Vola, the cocos2d-x has been successfully setup on your system.