I’d like to relate my experience of one year ago as a first-time cocos2d-x Android developer. I found that deciding upon and installing the right development tools was one of the most difficult tasks I had to undertake. I spent endless hours searching the mostly-outdated cocos2d-x forums, watching outdated videos linked from the cocos2d-x site, purchasing and reading the latest books from Packt Publishing (2015 being newest) which told me how to use the obsolete Eclipse plug-in. I had no success getting either Eclipse (which was really hard to find), or Android Studio device emulation to work. Slackmoehrle finally directed me to the installation docs page for the most up-to-date information. I finally settled on doing my editing in Xcode, debugging using Mac OS as the target with screen configurations that mirrored the dimensions of Android devices (which was faster to build than native Android), and final testing on different multi-OS Google Nexus phones using Terminal commands. These choices ended up being good ones for my development, and I was glad I took the time to figure it all out in advance. But it would have been nice if I could have easily found this information on how to install this set of development tools and environments when I first started.
Then I started development, porting my 16-level Apple SpriteKit game to cocos2d-x, which went fairly smoothly thanks to cocos2d-x’s good online API documentation. There were a few conversion challenges along the way, which I’ve documented here: www.doffen.org/porting-spritekit-to-cocos2d-x, if you’re curious.
Here are a few suggestions for the installation docs page at cocos2d-x.org/docs/static-pages/installation.html:
- This page needs a paragraph at the top stating something like “This page contains links to our most up-to-date installation advice. Cocos2d-x development environments are in a constant state of flux, and information you see elsewhere is likely to be outdated.”
- This page could also have a paragraph stating: For iOS development on a Mac you should use …, for Android development on a Mac you could use either … or …, etc.
- I had several false starts because setup.py wasn’t documented well here. Is a trailing slash required on the ANDROID_NDK_PATH and ANDROID_SDK_ROOT? (yes it is.) Do you need to specify the bin sub-directory for your ANT_ROOT directory? (yes you do.)
- How about some samples of the most useful Terminal commands, such as “android”, “cocos new …”, “cocos compile …”, “cocos run …”, and ‘adb logcat | grep “D/cocos”’, as well as a suggestion for adding the directory for these tools to the search path, and a suggestion on which directory to make as the current directory? This may seem like excessive hand-holding, but it can ease the pain for unfamiliar new users.
- Why does the Mac OS installation page refer to iOS targets? Isn’t the page for Mac OS supposed to be about targeting Mac OS, and the page for iOS supposed to be about targeting iOS?
- Be sure to mention the suggested changes to AndroidManifest.xml, strings.xml, and Android.mk, as well as where to find the directories that contain the master copies of these files.
- Take a look at this web site for some helpful Android development advice that can and should be incorporated into your getting-started materials online: heyalda.com/13-things-every-cocos2d-x-c-android-game-developer-should-know/.
I see that today the link to the installation page is broken, which may mean someone is already in the process of improving it. I’m very glad someone is working on these important instructions for getting started with cocos2d-x development. Thanks for doing it!