Monday, August 12, 2013

Create a multi-plaform cocos2d-x 3.0 project


Step 1 - Download cocos2d-x

Download your cocos2d-x directory
As a pre step 1 I would uninstall some of the previous version of the cocos2d Xcode templates by following this stackoverflow post.

Step 2 - Download & Install Python

Since the script "cocos2d-x/create-multi-platform-projects.py" is a python script. You will need to download and install Python 2.7. Skip to Step 3 if you have already downloaded and installed Python. After you've downloaded your python-2.7-macosx10.6.dmg. Open it up and double click on "Python.mpkg". I use Pacifist to install the multiple package file. Python will be installed at the "/usr/local/bin" directory by default. Be sure that directory is in your environment search PATH.


Step 3 - Run the Cocos2d-x create script

Go into your Cocos2d-x directory and run the script below. Be sure to replace the project name and your project identifier to your own. I'm assuming that you are creating a C++ project, thus "cpp".

cd cocos2d-x
python ./create-multi-platform-projects.py -p [ProjectName] -k [com.project.myproject] -l cpp


Step 4 - Open up your project

Your iOS Xcode project is now located at "cocos2d-x/projects/[ProjectName]/proj.ios"



Reference: How_to_create_a_multi-platform_project_in_one_command_line