欢迎来到代码驿站!

DOS/BAT

当前位置:首页 > 脚本语言 > DOS/BAT

BAT批处理一键生成APK包脚本分享

时间:2021-09-03 09:19:49|栏目:DOS/BAT|点击:

BAT批处理一键生成APK包脚本分享

将本bat放到cocos2dx目录下你的工程的project.android下(需修改变量)。
ASmaker 用来将Resources文件夹下的lua文件批量加密 算法参考我之前的rc4算法实现。

每次打包apk前 svn 最新的工程代码 和 cocos2dx引擎代码。

@echo off
rem 工具路径
set JAVA_HOME = "C:\Program Files\Java\jdk1.8.0_05"
set ANT_HOME = "D:\ProgramSoftware\apache-ant-1.9.4"
set ANDROID_HOME = "D:\ProgramSoftware\android sdk\sdk"
set NDK_HOME = "D:\ProgramSoftware\android-ndk-r9d-windows-x86_64\android-ndk-r9d"
set SVN_HOME = "C:\Program Files\TortoiseSVN\bin\"
 
rem 目标路径
set WORK_DIR = "D:\engine\projects\XXXXX\proj.android"
rem set PRO_DIR = "D:\engine\projects\XXXXX"
set RESOURCES_DIR= %WORK_DIR%\..\Resources
set ASSETS_DIR = %WORK_DIR%\assets
 
 
 
rem 先删除旧的assets
if exist D:\engine\projects\XXXXX\proj.android\assets (
  echo "deleting assets" 
  rd /q /s D:\engine\projects\XXXXX\proj.android\assets
)
 
rem 再删除旧有的Resources
if exist D:\engine\projects\XXXXX\Resources (
  echo "deleting Resources"
  rd /q /s D:\engine\projects\XXXXX\Resources
)
 
rem 删除旧的APK
if exist D:\engine\projects\XXXXX\proj.android\bin\XXXXX-release.apk (
  echo "deleting old APK"
  del /q /f D:\engine\projects\XXXXX\proj.android\bin\XXXXX-release.apk
)
 
rem call ant clean
 
rem svn
"C:/Program Files/TortoiseSVN/bin/TortoiseProc.exe" /command:update /path:"D:\engine\projects\XXXXX" /closeonend:1
"C:/Program Files/TortoiseSVN/bin/TortoiseProc.exe" /command:update /path:"D:\engine" /closeonend:1
 
pushd D:\engine\projects\XXXXX\proj.android
 
rem luajit Resources
for /r D:\engine\projects\XXXXX\Resources %%i in (*.lua) do ( 
  echo %%i  
  luajit.exe -b %%i %%i
)
 
rem ASmaker assets
ASmaker -i D:\engine\projects\XXXXX\Resources -o D:\engine\projects\XXXXX\proj.android\assets
 
rem ndk
call "D:\ProgramSoftware\android-ndk-r9d-windows-x86_64\android-ndk-r9d\ndk-build" -C "D:\engine\projects\XXXXX\proj.android" "NDK_MODULE_PATH=D:\engine;D:\engine\cocos2dx\platform\third_party\android\prebuilt"
 
rem ant release
call "D:\ProgramSoftware\android sdk\sdk\tools\android" update project -p "D:\engine\projects\XXXXX\proj.android"
call ant release 
 
popd
 
pause

上一篇:收集21个DOS常用命令

栏    目:DOS/BAT

下一篇:通过U盘实现本机添加管理员权限

本文标题:BAT批处理一键生成APK包脚本分享

本文地址:http://www.codeinn.net/misctech/172270.html

推荐教程

广告投放 | 联系我们 | 版权申明

重要申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:914707363 | 邮箱:codeinn#126.com(#换成@)

Copyright © 2020 代码驿站 版权所有