This tutorial from csdn blog: http://blog.csdn.net/zhaokaiqiang1992
Reprinted please note!
This tutorial mainly guides the novice in the Mac environment cocos2d-x development environment to build.
1. Download cocos2d-x
Download Site: http://cn.cocos2d-x.org/download/
Download the 3.x version and decompress it.
2. necessary software installation and environment Configuration
For cocos2d-x development, the software that must be installed has
Java SDK (MAC built-in)
Ant (installation can refer to this tutorial: http://www.cnblogs.com/ilovewindy/p/3860648.html)
Python (MAC built-in)
Xcode (download and install it)
Ndk (download and decompress it)
Android SDK (just download Google's ADT)
After the above software is installed, the most important thing is the configuration of environment variables.
Environment variables to be configured include:
Android_sdk_root
Ant_root
Ndk_root
The specific setting method is
Open the terminal and enter
Vim. bash_profile
This sentence means that you can use the vim editor to open. Bash_profile File
Click I to enter the insert mode.
As shown in
After entering the editing mode, change the path of each environment variable to your local path according to the above format.
After editing, click esc to exit the editing mode. Enter WQ and press enter to save the modification.
Enter source. bash_profile to make the modification take effect.
After all this is done, enter Cocos on the terminal. If no error is prompted, the environment variable is configured successfully.
3. Cocos Installation
In fact, we can start development after configuring the above environment variables, but in case we can check whether Cocos can find the environment variables we configured.
Use the CD command to enter the unzipping folder to the cocos2d-x, and then enter./setup. py. If the following result appears, the installation is successful
ThenWe can use the command
Cocos New-P com. qust. Game-l CPP-D/users/zhaokaiqiang/desktop newgame
To generate a new project
-P package name
-L development language used
-D storage location
Newgame project name
So far, mac under the development environment of the cocos2d-x is set up, use xcode for development!