Article content from: http://cocos2d-x.org/wiki/How_to_Start_A_New_Cocos2D-X_Game
Mac OS X 10.9
Software Requirements
- Xcode 4.6 (for iOS or Mac)
- Gcc 4.7 for Linux or Android. For Android ndk-r9 or newer is required.
- Visual Studio 2012 (for Windows)
- Python 2.7.5
Create A New Project
$ cd cocos2d-x$ ./setup.py$ source ~/.bash_profile # may be ~/.bash_login or ~/.profile, depends on your environemnt$ cocos new MyGame -p com.MyCompany.MyGame -l cpp -d ~/MyCompany
MyGame
: Name of your project
-p com.MyCompany.MyGame
: Package name for android
-l cpp
: Programming language used for the project, valid value iscpp
Andlua
-d ~/MyCompany
: Directory to hold your project
Folder structure of the generated project is as following:
(Note: The directory may be different when the project type is lua .)
Build And Run New Project
$ cocos run -s ~/MyCompany/MyGame -p ios
-s
: Directory of the new project. This cocould be an absolute path or a relative path.
-p
: Which platform to run on. Options areios
,android
,win32
,mac
Andlinux
.
(Note: You are a tmux user, you shoshould addreattach-to-user-namespace
Before the commandcocos
. For more information, please refer to this link for more information .)
You can runcocos run --help
For more detail information.