Install Cocos2d-x on Mac

14 May 2020

  1. download Cocos2d-x
  2. unzip and move the folder to Application folder
  3. Rename it to cocos2d-x
  4. cd cocos2d-x
  5. make sure the python version is 2.7
  6. Run setup script: ./setup.py (press enter to skip android config)
  7. Run source /Users/<user_name>/.zshrc to add command zsh/bash config for Cocos2d-x

Now you can start to use cocos commands

References

You may meet an error when compile in Xcode:

Argument value 10880 is outside

Replace

#define BT_SHUFFLE(x,y,z,w) ((w)<<6 | (z)<<4 | (y)<<2 | (x))

with

#define BT_SHUFFLE(x, y, z, w) (((w) << 6 | (z) << 4 | (y) << 2 | (x)) & 0xff)

Fix Reference

https://stackoverflow.com/questions/58064487/xcode-11-cocos2dx-compilation-problem-argument-value-10880-is-outside-the-vali

Back to top