cocos2dx 命令解释

原创 2015年07月11日 10:25:31

A command line tool that lets you create, run, publish, debug, etc… your game. It is the swiss-army knife for cocos2d.

This command line tool is in its early stages.

Commands Required

There are at least 2 groups of requirement currently. One is for cocos game project, such as newcompilerun, another is for updating cocos framework, such as versioninstallupdate.

  • project
    • new
    • run
    • compile
    • list // open recent projects
    • deploy
    • clean
    • device
  • engine
    • version
    • udpate
  • help
  • assets converter // convert the textures, audios into best file format for target platform. We need a resource manager in framework to do this.

cocos project new

cocos project new <project-name> [-l <cpp|lua|js>] [-p <package name>] [-d <directory>] [-t <template>] [-help]



Must be. The name of your project, wihtout space.

-l <cpp|lua|js>

Must be. Select the programming language for the new game. It can be , or 

-p <package-name>

Optional. Set to "com.mycompany.mygame" by default

-d \<directory>

Optional. By default it will create the new project in your current path

-t \<template>

TBD. We will offer more templates like shooter game, super mardio game, isometric game tempaltes

cocos project run

cocos project run <target> [-m <mode>]

This command will call compile and deplot



Must be. Targets can be , , , etc.

-m <debug|release>

Optional Mode can be or . By default it's debug mode.

cocos project compile

cocos compile -p <platform> [-s <project_dir][-m <mode>] [-j <number>] [-a <architecture>] [--ap <android_platform>]

Compiles the current project to binrary

-s the project base directory

Optional. if not it specified, use current dir

-p <platfrom>

Must be. Should be [android|ios|linux|mac|win32].

-m <debug|release>

Optional. Mode can be or . By default it's debug mode. In release mode, this command will compile lua or javascript into bytecode. Use debug by default.

-j <number>

Optional. How many threads to do the compilation

-a <architeture>

Architecture can be <arm><armeabi><arm64><x86> or <all>

--ap <android_platform>

The android sdk platform number, valid android-platform are:[10|11|12|13|14|15|16|17|18|19]

cocos project deploy

cocos project deploy -t <target>

Installs the package to a target device.

-t <target>

Targets can be , , 

cocos project clean

cocos clean <all>

Clean the compiled sources and assets on all platforms. By default, it cleans only your game, but reserve the binary output for framework. If you inputs , then it will clean both your game and the cocos2d-x framework

If you have a nice design please do not hesitate to write your idea here.


Cocos2d-x引擎除了提供了CCDirector,还提供了一个CCDisplayLinkDirector,CCDisplayLinkDirector是一个可以自动刷新的CCDdirector。 ...
  • sssssNian
  • sssssNian
  • 2014年05月19日 18:46
  • 874

cocos2dx 3.x 命令行创建和编译工程

1.设置环境变量 JAVA_HOME=C:\Program Files\Java\jdk1.7.0_17 CLASSPATH=.;%JAVA_HOME%\lib; Path增加%JAVA_H...
  • lzq0101
  • lzq0101
  • 2015年05月15日 01:38
  • 2639

【独立开发者er Cocos2d-x实战 011】Cocos2dx 3.x命令行生成APK详解

【独立开发者er Cocos2d-x实战 011】Cocos2dx 3.x命令行生成APK详解
  • chenqiai0
  • chenqiai0
  • 2015年07月21日 12:33
  • 4609


  • u011894560
  • u011894560
  • 2014年03月15日 23:51
  • 2036


  • luyafei_89430
  • luyafei_89430
  • 2014年08月08日 17:44
  • 6719


  • YorkCai
  • YorkCai
  • 2013年03月01日 14:31
  • 3389


  • pya19601213
  • pya19601213
  • 2014年07月27日 16:49
  • 2770

[cocos2dx 3.0 (五)] 使用游戏控制台Console + 添加用户自定义控制台命令

cocos2dx 3.0又出了新版本rc0,在beta2版本中使用Console在vs2012上存在bug,在rc0中已经都修复了,而且加了不少的新的控制台命令。游戏控制台是通过TCP来连接控制的,使...
  • u010300854
  • u010300854
  • 2014年03月26日 22:58
  • 2964


Filesystem Hierarchy Standard(FHS) /:根目录,所有的目录、文件、设备都在/之下,/就是Linux文件系统的组织者,也是最上级的领导者。    /bin:bin 就是...
  • White_Idiot
  • White_Idiot
  • 2016年09月08日 16:56
  • 1280

【cocos2d-x 3.x】02-简单看一下cocos的消息循环的步骤

帧循环 cocos是如何保持60帧一秒的 在执行完applicationDidFinishLaunching中我们自定义的初始化代码后,便开始游戏的帧循环 while(!glview->wind...
  • harry_ss
  • harry_ss
  • 2014年12月06日 22:22
  • 557
您举报文章:cocos2dx 命令解释