博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
cocos2dx 用命令行进行编译的指令
阅读量:7294 次
发布时间:2019-06-30

本文共 4431 字,大约阅读时间需要 14 分钟。

cocos compile -p android -m release -s F:\cocosproj\antest --ap android-20

上面那条就是我常用的指令,这指令修改一下就成了你的指令了。

我本来是想用android-studio出个包的,但是这个编译指令只是编译eslicps的工程,不过没关系,编译出so文件后就可以手动搬到android-studio那里去出包了。

 

下面是 cocos compile 详解 (以下内容转自 : http://blog.csdn.net/wanglang3081/article/details/39692459)

cocos compile

Overview

Build an existed project.

Usage

usage: cocos compile [-h] [-s SRC_DIR] [-q] [-p PLATFORM] [-m MODE] [-j JOBS]                     [--ap ANDROID_PLATFORM] [--ndk-mode NDK_MODE]                     [--source-map] [--sign-identity SIGN_ID] [--no-res]                     [--compile-script {0,1}] [--lua-encrypt]                     [--lua-encrypt-key LUA_ENCRYPT_KEY]                     [--lua-encrypt-sign LUA_ENCRYPT_SIGN]

Available Arguments

Common Arguments

arg available value sample description necessary
-h, --help - - Show the help message and exit no
-s, --src project path ./projects/MyLuaGame Specify the project path. Default value is current directory. no
-p, --platform the target platform android Specify the target platform. yes
-m, --mode the compiling mode release Set the compile mode, should be debug or release. Default is debug. no
-j, --jobs number of jobs at once 4 Use N jobs at once. It's only take effect with target android & linux. no
-o, --output-dir absolute/relative path ./release/android Specify the output directory. no

Android Arguments

arg available value sample description necessary
--ap folder name in ANDROID_SDK_ROOT/platforms android-16 Specify the API-Level of android sdk. Console will auto select it if not specified. no
--ndk-mode the compiling mode of ndk-build release Set the compile mode of ndk-build, should be one of {debug, release, none}, native code will not be compiled when the value is none. Default is same value with -m no

Web Arguments

arg available value sample description necessary
--source-map - - Enable source-map no
--advanced - - Set the compilationLevel value as advanced for js compiling. no

iOS/Mac Arguments

arg available value sample description necessary
-t, --target Target Name in XCode project MyGame iOS Specify the target name to compile. no

iOS Arguments

arg available value sample description necessary
--sign-identity the code sign identity "iPhone Distribution:xxxxxxxx" The code sign identity for iOS. It's required when the value of "-m, -mode" is release.

lua/js project Arguments

arg available value sample description necessary
--compile-script {0,1} 1 Disable/Enable the compiling of lua/js script files. If not specified, the value is 1 when -m, --mode is release. Otherwise, the value is 0 no

lua project Arguments

arg available value sample description necessary
--lua-encrypt - - Enable the encrypting of lua scripts. It's only take effect when --compile-script value is 1 no
--lua-encrypt-key any string MyLuaKey Specify the encrypt key for the encrypting of lua scripts. It's only take effect when --lua-encrypt is enabled. Default value is 2dxLua. no
--lua-encrypt-sign any string MyLuaSign Specify the encrypt sign for the encrypting of lua scripts. It's only take effect when --lua-encrypt is enabled. Default value is XXTEA. no

Attentions

  • You can see the valid target platforms without specify -p, --platform first. The available platforms will be shown like this:available platforms
  • --compile-script will not take effect when target is linux or web
  • If --lua-encrypt is enabled, you should modify the C++ code frameworks/runtime-src/Classes/AppDelegate.cpp like this:

    bool AppDelegate::applicationDidFinishLaunching(){    ...    auto engine = LuaEngine::getInstance();    ScriptEngineManager::getInstance()->setScriptEngine(engine);    // add these two lines     // "MyLuaKey" is the string specified by "--lua-encrypt-key"    // "MyLuaSign" is the string specified by "--lua-encrypt-sign"    LuaStack* stack = engine->getLuaStack();    stack->setXXTEAKeyAndSign("MyLuaKey", strlen("MyLuaKey"), "MyLuaSign", strlen("MyLuaSign"));    ...}

Samples

    • cocos compile -h. Show the help message.
    • cocos compile -s ./projects/MyLuaGame -p android --ndk-mode release --compile-script 1 --lua-encrypt
      Build MyLuaGame for android with ndk-build is release. And compile lua script files with encrypting.
    • cocos compile -s ./projects/MyLuaGame -p ios -m release --sign-identity "iPhone Distribution:xxxxxxxx"
      Build MyLuaGame for ios with release mode. Use the code sign identity "iPhone Distribution:xxxxxxxx".

 

转载于:https://www.cnblogs.com/jsfx/p/6544037.html

你可能感兴趣的文章
分类条件概率
查看>>
(Mirage系列之十)Mirage经典案例之系统恢复
查看>>
【Java 基础篇】【第三课】表达式、控制结构
查看>>
Linux系统密码忘记修改方法
查看>>
项目打包去掉调试时的NSLog、print
查看>>
Linux使用dd命令快速生成大文件
查看>>
php表单时间转换为时间戳-175
查看>>
手机网络制式
查看>>
参加51CTO学院软考培训,我通过啦!
查看>>
对“纯手工编写的第一个Hibernate程序”的改进
查看>>
Solr 5.4.0
查看>>
微信小程序 - 帮你妹
查看>>
nginx+keepalived双master负载均衡配置
查看>>
我的友情链接
查看>>
H5学习笔记1
查看>>
MySQL-MongoDB开源监控利器之PMM
查看>>
AGG第二课 代码框架以及命名规则
查看>>
C#学习基本概念之匿名方法及Lambda表达式
查看>>
Exchange Server 2013就地电子数据展示
查看>>
NFS启动报错
查看>>