unity打包脚本
程序员文章站
2022-03-07 11:53:18
require("utils") -- platform android ios -- switch public or dev -- cfg dev tencent_testAPP = '/Users/admin/2018.4.20f1/Unity.app/Contents/MacOS/Unity'PROJECT_DEV = '/Volumes/DISK/code/client2/wly2-publish/-Trunk/wly2_dev'PROJECT_PUBLISH = '/Volu.....
require("utils")
-- platform android ios
-- switch public or dev
-- cfg dev tencent_test
APP = '/Users/admin/2018.4.20f1/Unity.app/Contents/MacOS/Unity'
PROJECT_DEV = '/Volumes/DISK/code/client2/wly2-publish/-Trunk/wly2_dev'
PROJECT_PUBLISH = '/Volumes/DISK/code/client2/wly2-publish/-Trunk/wly2_publish'
DEST_PATH = '/Volumes/DISK/code/client2/wly2-publish/-Trunk/publish/'
args = {}
for k, v in ipairs(arg) do
local arr = string.split(v, "=")
if #arr == 2 then
args[arr[1]] = arr[2]
end
end
local cmd = string.format('svn revert -R %s;svn up %s', PROJECT_DEV, PROJECT_DEV)
local function switch()
if args.cfg == 'dev' then
cmd = cmd .. ';' .. string.format('%s -batchmode -quit -projectPath %s -logFile -executeMethod EditorTools_GameCfg.ImportGameCfg', APP, PROJECT_DEV)
elseif args.cfg == 'tencent_test' then
cmd = cmd .. ';' .. string.format('%s -batchmode -quit -projectPath %s -logFile -executeMethod EditorTools_GameCfg.ImportGameCfgTXTest', APP, PROJECT_DEV)
end
end
if args.platform == 'android' then
if args.switch == "dev" then
cmd = cmd .. ';' .. string.format('%s -batchmode -quit -projectPath %s -buildTarget Android -logFile', APP, PROJECT_DEV)
switch()
cmd = cmd .. ';' .. string.format('%s -batchmode -quit -projectPath %s -executeMethod Builder.BuildAndroidCmd -logFile', APP, PROJECT_DEV)
elseif args.switch == "public" then
end
end
print(cmd)
os.execute(cmd)
local path = ''
if args.switch == "dev" then
path = PROJECT_DEV
elseif args.switch == "public" then
path = PROJECT_PUBLISH
end
for file in lfs.dir(path) do
local f = path .. '/' .. file
if not isDir(f) then
local file_name, file_type = getFileType(f)
if file_type == 'apk' then
os.execute(string.format('mv %s %s', f, DEST_PATH .. file_name .. '-' .. args.switch .. os.date("%Y%m%d%H", os.time()) .. '.apk'))
elseif file_type == 'zip' then
os.execute(string.format('mv %s %s', f, DEST_PATH .. file_name .. '-' .. args.switch .. os.date("%Y%m%d%H", os.time()) .. '.zip'))
end
end
end
自动unity打包,持续优化中。
本文地址:https://blog.csdn.net/Jesse__Zhong/article/details/107167860
上一篇: java学习
下一篇: Android UI布局
推荐阅读
-
【Linux】MySQL 运维常用脚本
-
关于webpack打包报错Chunk.entrypoints:UseChunks.groupsIterableandfilterbyinstanceofEntrypointinstead的解决办法
-
Andriod studio 打包aar
-
IIS6、IIS7、IIS7.5取消服务器主机空间目录脚本的执行权限的方法
-
shell脚本运行5秒后自动退出的代码
-
一个用了统计CPU 内存 硬盘 使用率的shell脚本
-
正则爬取京东商品信息并打包成.exe可执行程序。
-
用来查看linux内存使用情况的shell脚本
-
一个简单的转换输出的shell脚本代码
-
linux和windows下的自动ftp脚本(shell bat)