http://code.google.com/p/cocos2d-x/downloads/list
cocos2d-x-3.0alpha0.zip
我们可以看到最新版本的3.0alpha0,这个版本提供了一个用python命令来建立各平台的项目,十分便利
下载,解压(建议解压到主目录下的)
http://www.python.org/getit/
建议选择2.7.5版本的下载
Python 2.7.5 Mac OS X 64-bit/32-bit x86-64/i386 Installer
Python 2.7.5 Mac OS X 32-bit i386/PPC Installer
下载,安装,然后在终端直接输入python,如果出现版本信息则安装成功
进入终端,执行以下命令
unzip cocos2d-x-3.0alpha0.zip cd cocos2d-x-3.0alpha0 python ./create-multi-platform-projects.py -p walker -k com.walkerfree.walker -l cpp
create-multi-platform-projects.py要求提供3个参数(工程名:我这里是walker,包名:我这里是com.walkerfree.walker,语言:cpp | js | lua)
执行成功会显示以下信息
proj.ios : Done! proj.android : Done! proj.win32 : Done! proj.mac : Done! proj.linux : Done! New project has been created in this path: /Users/davidzhang/Downloads/ios/cocos2d/cocos2d-x-3.0alpha0/projects/walker Have Fun!
进入walker目录,你可以看到这些项目
davidzhang@192:~/Downloads/ios/cocos2d/cocos2d-x-3.0alpha0$ cd projects/ davidzhang@192:~/Downloads/ios/cocos2d/cocos2d-x-3.0alpha0/projects$ ll total 0 drwxr-xr-x 3 davidzhang staff 102 10 8 15:51 . drwx------@ 33 davidzhang staff 1122 10 8 15:51 .. drwxr-xr-x 8 davidzhang staff 272 9 21 15:58 walker davidzhang@192:~/Downloads/ios/cocos2d/cocos2d-x-3.0alpha0/projects$ cd walker/ davidzhang@192:~/Downloads/ios/cocos2d/cocos2d-x-3.0alpha0/projects/walker$ ll total 0 drwxr-xr-x 8 davidzhang staff 272 9 21 15:58 . drwxr-xr-x 3 davidzhang staff 102 10 8 15:51 .. drwxr-xr-x 6 davidzhang staff 204 9 21 15:58 Classes drwxr-xr-x 6 davidzhang staff 204 9 21 15:58 Resources drwxr-xr-x 15 davidzhang staff 510 9 21 15:58 proj.android drwxr-xr-x 6 davidzhang staff 204 10 8 15:53 proj.ios_mac drwxr-xr-x 7 davidzhang staff 238 9 21 15:58 proj.linux drwxr-xr-x 11 davidzhang staff 374 9 21 15:58 proj.win32 davidzhang@192:~/Downloads/ios/cocos2d/cocos2d-x-3.0alpha0/projects/walker$
怎么样,全平台都给你搭好了,而且共用一个Classes文件夹,也就是说你在一个平台更新了代码,全平台都得到了更新。