This is the fastest, simplest, easiest, least wordy tutorial you’ll find on setting up an Xcode project that actually works.

  1. Download Cocos2D-X from here (This tutorial is using version 4.0)
  2. 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)
  3. 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
  4. Open a terminal and create a new project by running:
    cocos new <project name> -l cpp
  5. Once the project is created, cd into the directory and create the Xcode project by running:
    cocos run -p mac
  6. This will create the Xcode project in a directory called mac-build, compile the code, and run the template project.
  7. The cocos2d-x reference can be found here. Good luck with your project!


No responses yet

Leave a Reply

Your email address will not be published. Required fields are marked *