Cocos2d-x tutorial (22)-Build a quick cocos2d-x compiling environment under Mac

Source: Internet
Author: User

Quick cocos2d-x 2.2.1 + Xcode 5.0 + OS X 10.9


Welcome to Cocos2d-x chat group: 193411763


1. I know that Xcode has been installed on your computer (you have not downloaded it yourself). Open Xcode and open the "Preference setting" dialog box (commond + ,). If this dialog box appears, install commond line tools directly:


If you are .... <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4KPHA + pgltzybzcm9 "http://www.2cto.com/uploadfile/Collfiles/20140226/20140226092558156.jpg" alt = "\">

How to install commond line tools in your OS X system 10.9 or later? That's easier.

Enter the terminal and enter the following command line:

Xcode-select -- install

Then, a prompt is displayed. Select "Install:



2. Download quick cocos2d-x current quick cocos2d-x stable version is 2.2.1, download link: http://cn.quick-x.com /? Page_id = 198

3. After the download is complete, decompress it to the desktop, start the terminal, and enter:

Touch ~ /. Bash_profile

Open ~ /. Bash_profile-a TextEdit

Press enter to confirm, and then enter the following in the new dialog box:

Export ANDROID_NDK_ROOT = /Android/android-ndk-r8e

Export ANDROID_SDK_ROOT = /Android-sdk-macosx

Export QUICK_COCOS2DX_ROOT = Quick-cocos2d-x

Export COCOS2DX_ROOT =$ {QUICK_COCOS2DX_ROOT}/lib/cocos2d-x

Export ANDROID_HOME =$ {ANDROID_SDK_ROOT}

The configuration of the Android environment variables is included here. If the Android environment variable is not available, the following message is displayed:

-Bash: PATH_TO: No such file or directory

Don't worry, no impact, such:


4. Start Xcode and add Source Trees in "preference settings:


The Name and DisplayName are the same. Path is the Path of the quick cocos2d-x folder in your computer, if you do not know, teach you a way. Open the terminal, drag the folder of the quick cocos2d-x-rc in, the terminal will display its path, and then copy and paste it.


After the above operations are completed, the environment is set up. Next we will create a project to open the terminal:

Input:

1. cd Desktop (because my quick folder is on the Desktop)

2. cd quick-cocos2d-x-2.2.1-rc

3. cd bin

4../create_project.sh-o landscape com. Reventon. Game. testGame


-O is used to specify the screen direction. landscape is a horizontal screen, and portrait is a vertical screen. TestGame is the project name (excluding the previous .)

After the project is created, its path is located at: quick-cocos2d-x-2.2.1-rc/bin/testgame

Open the Xcode file in the proj. ios folder and run the project to view HelloWorld.




Related Article

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.