Full guide to cocos2d-x development environment in MAC Environment

Source: Internet
Author: User

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.