Cocos2d iPhone environment setup

Source: Internet
Author: User

1: first, install the xcode development environment.

(If you have not installed the xcode development environment, you can download it from the appstore. It is very convenient [you only need to register it to download it for free, and the latest version is xcode4.5 ])

 

2: The cocos2d open source library is as follows:

Http://code.google.com/p/cocos2d-iphone/downloads/list

The latest beta (cocos2d-iphone-2.1-beta2.tar.gz)

 

3: After the download is complete, decompress the package and execute the cocos2d template installation script on the terminal.

The procedure is as follows:

1. decompress the following file (cocos2d-iphone-2.1-beta2.tar.gz)

2) Open the terminal and run the CD command to change the current directory environment.

[CD command Description: Change directory]

3) obtain the path of the decompressed folder, select the decompressed file, and right-click "show Introduction"

 

In the pop-up box, you can see the location information:/volumes/HD2-iOS/6-Games copy it

Execute commands on the terminal

CDS/volumes/HD2-iOS/6-Games

CD cocos2d-iphone-2.1-beta2

/Install-templates.sh

======================================

A logon password is prompted during installation.

Logs printed during installation:

Installing cocos2d templates

----------------------------------------------------


... Creating destination Directory:/users/Apple/library/developer/xcode/templates/cocos2d v2.x/


... Copying cocos2d files


... Copying cocosdenshion files


... Copying cocosdenshionextras files


... Copying kazmath files


... Copying template files


Done!


Installing physics engines templates


----------------------------------------------------


... Copying box2d files


... Copying chipmunk files


Done!


Installing JS bindings templates


----------------------------------------------------


... Copying jsbindings files


... Copying spidermonkey files


... Copying Jr swizzle files


... Copying cocosbuilderreader files


Done!


Installing ccnode file templates...


----------------------------------------------------


... Creating destination Directory:/users/Apple/library/developer/xcode/templates/file templates/cocos2d v2.x/


Done!

 

Here, the cocos2d template is installed.

 

4) Open xcode and you will see the cocos2d Project template.

 

5) use the cocos2d template to create a helloworld game without writing a line of code.

Click "Next"

 

After the project is created, you can view the project structure.

Click the "run button" on the interface or press the shortcut key: Command + R, you can run the cocos2d-helloworld game.

 


Cocos2d iPhone environment setup

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.