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

(编辑:jimmy 日期: 2024/12/24 浏览:2)

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

一句话新闻

一文看懂荣耀MagicBook Pro 16
荣耀猎人回归!七大亮点看懂不只是轻薄本,更是游戏本的MagicBook Pro 16.
人们对于笔记本电脑有一个固有印象:要么轻薄但性能一般,要么性能强劲但笨重臃肿。然而,今年荣耀新推出的MagicBook Pro 16刷新了人们的认知——发布会上,荣耀宣布猎人游戏本正式回归,称其继承了荣耀 HUNTER 基因,并自信地为其打出“轻薄本,更是游戏本”的口号。
众所周知,寻求轻薄本的用户普遍更看重便携性、外观造型、静谧性和打字办公等用机体验,而寻求游戏本的用户则普遍更看重硬件配置、性能释放等硬核指标。把两个看似难以相干的产品融合到一起,我们不禁对它产生了强烈的好奇:作为代表荣耀猎人游戏本的跨界新物种,它究竟做了哪些平衡以兼顾不同人群的各类需求呢?