To http://www.cocos.com/download/#下载mac the next file
Unzip the compressed package you just downloaded into the folder you specified, such as on the desktop.
cd/users/dream/desktop/cocos2d-x-3.6/tools/cocos2d-console/bin/ cocos.py
Open terminal Run cocos.py script Create file
./cocos.py new HelloWorldDemo -p com.coco2dx.org -l cpp -d ~/Desktop或者python cocos.py new HelloWorldDemo -p com.coco2dx.org -l cpp -d ~/Desktop
如果提示cocos.py permission denied
是权限问题,可以先使用chmod命令获得权限,输入chmod u+x ./cocos.py 回车,接着再使用cocos.py创建项目,则可以成功创建
Parameter description:
- Helloworlddemo for Project name
-p
After the package name
-l
followed by the development of the language type, there are CPP, LUA, JS three types
-d
The directory after which the project is stored
Run the project
After the project is created, use Xcode to open the Xcode project file in Helloworlddemo/proj.ios_mac , run the project file, and then-D in the path later
cocosx2d Xcode under Environment construction