cocos2dx 用命令行进行编译的指令
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, --platformfirst. The available platforms will be shown like this: --compile-scriptwill not take effect when target islinuxorwebIf
--lua-encryptis enabled, you should modify the C++ codeframeworks/runtime-src/Classes/AppDelegate.cpplike 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
BuildMyLuaGamefor 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"
BuildMyLuaGamefor ios with release mode. Use the code sign identity"iPhone Distribution:xxxxxxxx".
cocos2dx 用命令行进行编译的指令的更多相关文章
- VS2015——命令行下编译、静态库动态库制作以及断点调试
c程序编译流程 程序的基本流程如图: 1. 预处理 预处理相当于根据预处理指令组装新的C/C++程序.经过预处理,会产生一个没有宏定义,没有条件编译指令,没有特殊符号的输出文件,这个文件的含义同原本的 ...
- c# 命令行下编译c#文件 // c# file类读写文件
c# 命令行下编译c#文件 2010-03-01 15:02:14| 分类: c# 学习|字号 订阅 在 开始 ——>程序 ——>vstool中打开vs2008命令提示. 通过 ...
- [转]Windows中使用命令行方式编译打包Android项目
http://my.oschina.net/liux/blog/37875 网上很多用Ant来编译打包Android应用的文章,毕竟Ant是纯Java语言编写的,具有很好的跨平台性.今天想写个纯win ...
- Android系列之Android 命令行手动编译打包详解
Android 命令行手动编译打包过程图 [详细步骤]: 1使用aapt生成R.java类文件: 例: E:\androidDev\android-sdk-windows2.2\tools> ...
- Java带包结构调用命令行运行编译
原文: https://www.toutiao.com/i6491809562037846542/ 带包结构调用命令行运行编译. 记事本编写两个简单的类 文件结构目录 启动DOS,进入文件所在目录 分 ...
- delphi DCC32命令行方式编译delphi工程源码
本文链接地址:http://blog.csdn.net/sushengmiyan/article/details/10284879 作者:苏生米沿 Borland出品的Delphi,在TIOBE公布的 ...
- 【Java】【转】在命令行中编译和运行java
原文:http://blog.csdn.net/u010900574/article/details/50792353 同时加载编译多个jar包和java文件 在个人平常使用或者当我们把代码部署到Li ...
- JNI之——在cmd命令行下编译执行C/C++源文件
转载请注明出处:http://blog.csdn.net/l1028386804/article/details/46604269 一直用java来敲代码,java配置好jre路径之后.在cmd下编译 ...
- 在linux命令行中编译和运行java文件
同时加载编译多个jar包和java文件 在个人平常使用或者当我们把代码部署到linux服务器上的时候,我们经常需要通过命令行编译和运行java文件,网上关于这个的方法大多是通过 javac -cp f ...
随机推荐
- 通过usb访问mtp设备(ubuntu12.04) (转载)
转自:http://robert.penz.name/658/howto-access-mtp-devices-via-usb-on-ubuntu-12-04/ A friend asked me h ...
- bzoj 1700: [Usaco2007 Jan]Problem Solving 解题【dp】
很像贪心的dp啊 这个定金尾款的设定让我想起了lolita和jk制服的尾款地狱-- 设f[i][j]为从j到i的付定金的最早月份然后从f[k][j-1]转移来,两种转移f[i][j]=min(f[i] ...
- 10.9NOIP模拟题
/* big模拟 细节不少 remove表示这个玩意儿在这一秒有没有移动 注意在一秒内所有小葱一起移动,所以如果一个一个处理 别忘了“错位”这种情况 */ #include<iostream&g ...
- 设置VMWare虚拟机使拷贝虚拟机后固定原有的IP地址
VMWare中已经安装并设置好的虚拟机在拷贝给别人后,再次打开该虚拟机时原有自动获取的IP地址将会变化,那么原有根据该IP地址进行的设置均将失效,还需要重新设置,比较麻烦,经过百度查询原来可以将虚拟机 ...
- pyDes 实现 Python 版的 DES 对称加密/解密--转
https://my.oschina.net/leejun2005/blog/586451 手头有个 Java 版的 DES 加密/解密程序,最近想着将其 Python 重构下,方便后续脚本解析,捣鼓 ...
- Asp 循环输出 form 表单提交的数据
亲测asp提交form表单数据,在接收页面循环输出数据 dim var for each var in request.form response.write var&"=" ...
- Modbus通讯协议简介
Modbus协议简介 Modbus协议最初由Modicon公司开发出来,此协议支持传统的RS-232.RS-422.RS-485和以太网设备,许多工业设备,包括PLC,DCS,智能仪表等都在使用Mod ...
- P2668 斗地主 贪心+深搜
题目描述 牛牛最近迷上了一种叫斗地主的扑克游戏.斗地主是一种使用黑桃.红心.梅花.方片的A到K加上大小王的共54张牌来进行的扑克牌游戏.在斗地主中,牌的大小关系根据牌的数码表示如下:3<4< ...
- 42使用NanoPiM1Plus在Android4.4.2下的录音测试
42使用NanoPiM1Plus在Android4.4.2下的录音测试 大文实验室/大文哥壹捌陆捌零陆捌捌陆捌贰21504965 AT qq.com完成时间:2017/12/5 17:51版本:V1. ...
- Fiddler—重复发送一个请求的设置
https://jingyan.baidu.com/article/b2c186c829a85dc46ff6ff60.html 选中一个request——>Reissue Sequentaill ...