首先,你需要下载三个文件:每间
android-ndk
android-sdk
ant
下载位置可以随意:由于3.0rc2执行setup.py 自己主动搜索这三个文件
win32cmd以下:
(1):cmd下找到cocos2d-x 3.0rc 文件夹,执行setup.py 文件:
Microsoft Windows [版本号 6.1.7601]
版权全部 (c) 2009 Microsoft Corporation。保留全部权利。
C:UsersAdministrator>:
C:UsersAdministrator>e:
E:>cd E:cocos3.0rccocos2d-x-3.0rc2
E:cocos3.0rccocos2d-x-3.0rc2>setup.py
Setting up cocos2d-x...
->Check environment variable COCOS_CONSOLE_ROOT
->Find environment variable COCOS_CONSOLE_ROOT...
->COCOS_CONSOLE_ROOT is found : E:cocos3.0crcocos2d-x-3.0rc1 ools/cocos2d
-console/bin
->Remove directory "E:cocos3.0crcocos2d-x-3.0rc1 oolscocos2d-consolein"
from PATH!
->Add directory "E:cocos3.0rccocos2d-x-3.0rc2 oolscocos2d-consolein" int
o PATH succeed!
->Force update environment variable COCOS_CONSOLE_ROOT
->Succeed : COCOS_CONSOLE_ROOT=E:cocos3.0rccocos2d-x-3.0rc2 oolscocos2d-
consolein
->Check environment variable NDK_ROOT
->Find environment variable NDK_ROOT...
->NDK_ROOT is found : E:android_NDKandroid-ndk-r9c
->Check environment variable ANDROID_SDK_ROOT
->Find environment variable ANDROID_SDK_ROOT...
->ANDROID_SDK_ROOT is found : E:SDK_Eclipseadt-bundle-windows-x86-20131030
sdk
->Check environment variable ANT_ROOT
->Find environment variable ANT_ROOT...
->ANT_ROOT is found : E:apache-ant-1.9.3in
Please restart the terminal or restart computer to make added system variables t
ake effect
E:cocos3.0rccocos2d-x-3.0rc2>
以下就能够创建project了:超级方便:
直接执行cocos new (在执行cocos new 之前你必须先关闭cmd 然后 又一次启动cmd )
Microsoft Windows [版本号 6.1.7601]
版权全部 (c) 2009 Microsoft Corporation。
保留全部权利。
C:UsersAdministrator>e:
E:>cd E:cocos3.0rccocos2d-x-3.0rc2
E:cocos3.0rccocos2d-x-3.0rc2>cocos new
E:cocos3.0rccocos2d-x-3.0rc2>python E:cocos3.0rccocos2d-x-3.0rc2 oolscocos
2d-consolein/cocos.py new
Runing command: new
usage: cocos new [-h] [-p PACKAGE_NAME] -l {cpp,lua,js} [-d DIRECTORY]
[-t TEMPLATE_NAME] [--no-native]
[PROJECT_NAME]
cocos new: error: argument -l/--language is required
E:cocos3.0rccocos2d-x-3.0rc2>
以下我们来创建一个helloworld
cocos new HelloWorld -p com.cocos2d.org -l cpp -d ~/Text/code/
E:cocos3.0rccocos2d-x-3.0rc2>python E:cocos3.0rccocos2d-x-3.0rc2 oolscocos
2d-consolein/cocos.py new HelloWorld -p com.cocos2d.org -l cpp -d ~/Text/cod
e
Runing command: new
> Copy template into E:cocos3.0rccocos2d-x-3.0rc2~TextcodeHelloWorld
> Copying cocos2d-x files...
> Rename project name from 'HelloCpp' to 'HelloWorld'
> Replace the project name from 'HelloCpp' to 'HelloWorld'
> Replace the project package name from 'org.cocos2dx.hellocpp' to 'com.cocos2d.
org'
E:cocos3.0rccocos2d-x-3.0rc2>
以下我们来一键打包到各个平台:
比如android平台:
E:cocos3.0rccocos22d-x 3.0rc2> cd ~/Text/code/HelloWorld/
是不是比一次更人性化.....
版权声明:本文博主原创文章。博客,未经同意不得转载。