This is the fastest, simplest, easiest, least wordy tutorial you’ll find on setting up an Xcode project that actually works.
- Download Cocos2D-X from here (This tutorial is using version 4.0)
- Extract the zip and move the folder to somewhere like ~/Documents (If you leave it in your downloads folder you may delete it accidentally during a cleanup)
- cocos is the terminal command used to create the cocos2d-x project and the Xcode files. Add it to your path by editing ~/.zshrc and adding the following line to the bottom:
export PATH=$PATH:/Users/(your username)/Documents/cocos2d-x-4.0/tools/cocos2d-console/bin
- Open a terminal and create a new project by running:
cocos new <project name> -l cpp
- Once the project is created, cd into the directory and create the Xcode project by running:
cocos run -p mac
- This will create the Xcode project in a directory called
mac-build, compile the code, and run the template project.
- The cocos2d-x reference can be found here. Good luck with your project!