unity cloud build · 万事俱备,请点击start cloud build...

13
Unity Cloud Build用户手册 功能 支持将用户的工程在云端进行多目标构建 支持将用户构建完成的包托管在云端进行分发 支持工程上传方式 COS FTP 支持版本控制系统 GIT Mercurial SVN 支持构建目标(Build TargetAndroid WebGL Windows Standalone Windows Standalone 64bit Standalone OSX 下载 Unity Package https://unitycloud.oss-cn-beijing.aliyuncs.com/cloud-build-plugin.unitypackage 命令行 [Win] https://unitycloud.oss-cn-beijing.aliyuncs.com/CloudBuildCmd-win.zip [Mac] https://unitycloud.oss-cn-beijing.aliyuncs.com/CloudBuildCmd-mac.zip [Linux] https://unitycloud.oss-cn-beijing.aliyuncs.com/CloudBuildCmd-linux.zip 快速上手 下载Unity Editor Unity 2018.3.14f1为例 下载DEMO工程 (可自行准备Unity工程) https://unitycloud.oss-cn-beijing.aliyuncs.com/StandardAssetsExampleProject.zip 下载云构建Package Unity Editor打开工程 导入云构建测试包 Asset —> Import Package —> Customer Package ... 点击Import按钮

Upload: others

Post on 07-Jul-2020

17 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Unity Cloud Build · 万事俱备,请点击Start Cloud Build 如果需要中断构建,可以点击Cancel Cloud Build image-20190927182044919 在Build Status 中监控构建进度

Unity Cloud Build用户手册

功能

支持将用户的工程在云端进行多目标构建

支持将用户构建完成的包托管在云端进行分发

支持工程上传方式

COSFTP

支持版本控制系统

GITMercurialSVN

支持构建目标(Build Target)

AndroidWebGLWindows StandaloneWindows Standalone 64bitStandalone OSX

 

下载

Unity Package

https://unitycloud.oss-cn-beijing.aliyuncs.com/cloud-build-plugin.unitypackage

命令行

[Win] https://unitycloud.oss-cn-beijing.aliyuncs.com/CloudBuildCmd-win.zip

[Mac] https://unitycloud.oss-cn-beijing.aliyuncs.com/CloudBuildCmd-mac.zip

[Linux] https://unitycloud.oss-cn-beijing.aliyuncs.com/CloudBuildCmd-linux.zip

快速上手

下载Unity Editor

以Unity 2018.3.14f1为例下载DEMO工程 (可自行准备Unity工程)

https://unitycloud.oss-cn-beijing.aliyuncs.com/StandardAssetsExampleProject.zip

下载云构建Package

用Unity Editor打开工程

导入云构建测试包

Asset —> Import Package —> Customer Package ...点击Import按钮

Page 2: Unity Cloud Build · 万事俱备,请点击Start Cloud Build 如果需要中断构建,可以点击Cancel Cloud Build image-20190927182044919 在Build Status 中监控构建进度

菜单Window —> Cloud Build

选择Cloud Build Mode为COS (默认上传方式)

点击Config Packing Directories

默认会勾选必要的文件夹用户可以自行勾选自定义的文件夹

Page 3: Unity Cloud Build · 万事俱备,请点击Start Cloud Build 如果需要中断构建,可以点击Cancel Cloud Build image-20190927182044919 在Build Status 中监控构建进度

选择Upload Mode为Delta (默认以Diff增量模式上传)点击Pack按钮,等待打包结束,打包过程中不能做其他操作

点击Upload按钮,等待上传过程中可以做其他操作,下方会有上传进度条

Page 4: Unity Cloud Build · 万事俱备,请点击Start Cloud Build 如果需要中断构建,可以点击Cancel Cloud Build image-20190927182044919 在Build Status 中监控构建进度

勾选构建目标(Build Targets)

至少勾选一个构建目标可勾选多个构建目标

Page 5: Unity Cloud Build · 万事俱备,请点击Start Cloud Build 如果需要中断构建,可以点击Cancel Cloud Build image-20190927182044919 在Build Status 中监控构建进度

万事俱备,请点击Start Cloud Build

如果需要中断构建,可以点击Cancel Cloud Build

image-20190927182044919

在Build Status中监控构建进度

构建过程中可以断网,可以退出Unity Editor点击Track This Task By WeChat,使用微信扫描弹出的二维码后可以用微信小程序进行监控

在微信小程序中,点击完成时候通知按钮,可以接收构建完成通知

Page 6: Unity Cloud Build · 万事俱备,请点击Start Cloud Build 如果需要中断构建,可以点击Cancel Cloud Build image-20190927182044919 在Build Status 中监控构建进度

在微信小程序中查看构建日志和复制构下载链接

可以将微信小程序中的项目分享给他人

Page 7: Unity Cloud Build · 万事俱备,请点击Start Cloud Build 如果需要中断构建,可以点击Cancel Cloud Build image-20190927182044919 在Build Status 中监控构建进度

长按项目卡片,可以批量选择项目进行删除和分享操作

在Unity Editor中,构建完成后点击Action按钮(以Android为例)

点击QR Code,使用手机(安卓)扫描二维码下载安装APK点击Download按钮,可以通过浏览器下载构件好的打包文件点击Copy Download按钮,会将下载链接保存到剪贴板点击Print Log按钮,会将构建日志打印到Console输出

 

命令行 解压得到可执行文件

打印帮助信息

使用和可执行文件同目录的 cloudBuild.json 启动

使用指定路径的配置文件启动

配置文件示例

unzip CloudBuildCmd-win.zip

CloudBuildCmd-win.exe -h

CloudBuildCmd-win.exe

CloudBuildCmd-win.exe -configFile <configFilePath>

Page 8: Unity Cloud Build · 万事俱备,请点击Start Cloud Build 如果需要中断构建,可以点击Cancel Cloud Build image-20190927182044919 在Build Status 中监控构建进度

配置项

是否必须

默认值 说明

projectPath 是 - 项目所在的文件夹路径

unityVersion 是 -用于构建项目的Unity版本号,格式为x.y.z

buildTargets 是 -

StandaloneOSX

StandaloneWindows

StandaloneWindows64

Android WebGL

bundleVersion 否${projectPath}\ProjectSettings\ProjectSettings.asset中配置的bundleVersion

版本号

productName 否${projectPath}\ProjectSettings\ProjectSettings.asset中配置的productName

项目名称

username 是 - Unity ID用户名

password 是 - Unity ID密码

uploadType 是 -COS FTP GIT SVN

MERCURIAL

resultFilePath 是 可执行文件所在目录构建结果文件路径,可以指定一个路径,也可以指定到具体的文件名

customExcludeFolders 否 空数组 不参与构建的目录

ftpServer 否 空字符串 FTP模式下服务器IP

ftpPort 否 21 FTP模式下服务器端口

ftpUsername 否 空字符串 FTP模式下FTP用户名

ftpPassword 否 空字符串 FTP模式下FTP密码

relativePath 否 空字符串Unity工程根目录在repo中的路径

repoURL 否 空字符串在 GIT SVN MERCURIAL模式

下的仓库路径

repoUsername 否 空字符串在 GIT SVN MERCURIAL模式

下的用户名

repoPassword 否 空字符串在 GIT SVN MERCURIAL模式

下的密码

repoToken 否 空字符串在 GIT SVN MERCURIAL模式

下的访问仓库的Token

JSON配置项说明

结果文件示例

{

   "projectPath": "E:\\SampleProject",

   "unityVersion": "2018.3.14",

   "buildTargets": ["Android", "StandaloneOSX", "WebGL"],

   "username": "<unity-id-username>",

   "password": "<unity-id-password>",

   "uploadType": "COS",

   "customExcludeFolders": ["build"]

}

Page 9: Unity Cloud Build · 万事俱备,请点击Start Cloud Build 如果需要中断构建,可以点击Cancel Cloud Build image-20190927182044919 在Build Status 中监控构建进度

 

命令行截图

{

   "errorCode": 0,

   "errorMessage": "",

   "taskUuid": "0decd631-382f-470c-aecb-fc8971437917",

   "jobs": [

      {

           "name": "98c7c6dc-faa9-46d8-a821-21a5d1753ef6",

           "buildTarget": "StandaloneOSX",

           "status": "SUCCESS",

           "logLink": "https://ucb-result-1258948065.cos.ap-

shanghai.myqcloud.com/5f69d81e56d7367a4ac50205d26064d7/1472e554-1879-4b66-9af1-

5ff76ad34878-StandaloneOSX.log",

           "downloadLink": "https://ucb-result-1258948065.cos.ap-

shanghai.myqcloud.com/5f69d81e56d7367a4ac50205d26064d7/1472e554-1879-4b66-9af1-

5ff76ad34878-StandaloneOSX.zip"

      },

      {

           "name": "43d9a21e-7ef0-4c5a-a296-199c7cb5be6f",

           "buildTarget": "Android",

           "status": "SUCCESS",

           "logLink": "https://ucb-result-1258948065.cos.ap-

shanghai.myqcloud.com/5f69d81e56d7367a4ac50205d26064d7/1472e554-1879-4b66-9af1-

5ff76ad34878-Android.log",

           "downloadLink": "https://ucb-result-1258948065.cos.ap-

shanghai.myqcloud.com/5f69d81e56d7367a4ac50205d26064d7/1472e554-1879-4b66-9af1-

5ff76ad34878-Android.apk"

      },

      {

           "name": "62d83a80-c6e1-4232-b86c-5973b4bc4a45",

           "buildTarget": "WebGL",

           "status": "SUCCESS",

           "logLink": "https://ucb-result-1258948065.cos.ap-

shanghai.myqcloud.com/5f69d81e56d7367a4ac50205d26064d7/1472e554-1879-4b66-9af1-

5ff76ad34878-WebGL.log",

           "downloadLink": "https://ucb-result-1258948065.cos.ap-

shanghai.myqcloud.com/5f69d81e56d7367a4ac50205d26064d7/1472e554-1879-4b66-9af1-

5ff76ad34878-WebGL.zip"

      }

  ]

}

Page 10: Unity Cloud Build · 万事俱备,请点击Start Cloud Build 如果需要中断构建,可以点击Cancel Cloud Build image-20190927182044919 在Build Status 中监控构建进度

 

FTP流程

在Cloud Build Mode中下拉选择FTP

用户使用自己搭建的FTP,填入Host / Port / Username / Password信息

请确保该FTP对公网开放

剩余步骤参考 快速上手 部分

命令行

{

   "projectPath": "E:\\SampleProject",

   "unityVersion": "2018.3.14",

   "buildTargets": ["Android", "StandaloneOSX", "WebGL"],

   "username": "<unity-id-username>",

   "password": "<unity-id-password>",

   "uploadType": "FTP",

   "resultFilePath": ".",

   "customExcludeFolders": ["build"],

   "ftpServer": "129.211.136.209",

   "ftpPort": "21",

   "ftpUsername": "ucbFtp",

   "ftpPassword": "ucbFtpPassword"

}

Page 11: Unity Cloud Build · 万事俱备,请点击Start Cloud Build 如果需要中断构建,可以点击Cancel Cloud Build image-20190927182044919 在Build Status 中监控构建进度

 

GIT流程

在Cloud Build Mode中下拉选择GIT

Credential Mode选择UserPassword

输入用户名密码Credential Mode选择GitToken

输入GIT TokenRelative Path选择Unity项目根目录相对于REPO根目录的相对路径

Sample GIT 工程

剩余步骤参考 快速上手 部分

命令行

 

Mercurial流程

在Cloud Build Mode中下拉选择MERCURIA

Relative Path选择Unity项目根目录相对于REPO根目录的相对路径

Sample Mercurial 工程

剩余步骤参考 快速上手 部分

命令行

Repository: https://gitee.com/ucbdemo/sample.git

Username: ucbdemo

Password: ucbdemo123

{

   "unityVersion": "2018.3.14",

   "buildTargets": ["Android", "StandaloneOSX", "WebGL"],

   "username": "<unity-id-username>",

   "password": "<unity-id-password>",

   "uploadType": "GIT",

   "resultFilePath": ".",

   "customExcludeFolders": ["build"],

   "repoURL": "https://gitee.com/ucbdemo/skyboxWithRelativePath.git",

   "repoBranch": "master",

   "repoUsername": "ucbdemo",

   "repoPassword": "ucbdemo123",

   "relativePath": "/internal skybox/skybox",

   "productName": "gitTest",

   "bundleVersion": "1.0"

}

Repository: https://bitbucket.org/unityucbdemo/skybox

Username: unityucbdemo

Password: 4ZKmazyyQdgmDuCcz28j

Page 12: Unity Cloud Build · 万事俱备,请点击Start Cloud Build 如果需要中断构建,可以点击Cancel Cloud Build image-20190927182044919 在Build Status 中监控构建进度

 

SVN流程

在Cloud Build Mode中下拉选择SVN

Relative Path选择Unity项目根目录相对于REPO根目录的相对路径

Sample SVN 工程

剩余步骤参考 快速上手 部分

命令行

 

可支持Unity版本

2017

{

   "unityVersion": "2018.3.14",

   "buildTargets": ["Android", "StandaloneOSX", "WebGL"],

   "username": "<unity-id-username>",

   "password": "<unity-id-password>",

   "uploadType": "MERCURIAL",

   "resultFilePath": "./result.txt",

   "repoURL": "https://bitbucket.org/unityucbdemo/skybox",

   "repoUsername": "unityucbdemo",

   "repoPassword": "4ZKmazyyQdgmDuCcz28j",

   "productName": "hgTest",

   "bundleVersion": "1.0"

}

Repository: svn://svnbucket.com/ucbdemo/skybox

Username: ucbdemo

Password: ucbdemo123

{

   "unityVersion": "2018.3.14",

   "buildTargets": ["Android", "StandaloneOSX", "WebGL"],

   "username": "<unity-id-username>",

   "password": "<unity-id-password>",

   "uploadType": "SVN",

   "resultFilePath": "./result.txt",

   "repoURL": "svn://svnbucket.com/ucbdemo/skybox/",

   "repoUsername": "ucbdemo",

   "repoPassword": "ucbdemo123",

   "productName": "svnTest",

   "bundleVersion": "1.0"

}

Page 13: Unity Cloud Build · 万事俱备,请点击Start Cloud Build 如果需要中断构建,可以点击Cancel Cloud Build image-20190927182044919 在Build Status 中监控构建进度

2018

2019

 

2017.1.0 2017.1.1, 2017.1.2, 2017.1.3, 2017.1.4, 2017.1.5, 2017.2.0, 2017.2.1,

2017.2.2, 2017.2.3, 2017.2.4, 2017.2.5, 2017.3.0, 2017.3.1, 2017.4.0, 2017.4.1,

2017.4.2, 2017.4.3, 2017.4.4, 2017.4.5, 2017.4.6, 2017.4.7, 2017.4.8, 2017.4.9,

2017.4.10, 2017.4.11, 2017.4.12, 2017.4.13, 2017.4.14, 2017.4.15, 2017.4.16,

2017.4.17, 2017.4.18, 2017.4.19, 2017.4.20, 2017.4.21, 2017.4.22, 2017.4.23,

2017.4.24, 2017.4.25, 2017.4.26, 2017.4.27, 2017.4.28, 2017.4.29, 2017.4.30,

2017.4.31, 2017.4.32, 2017.4.33

2018.1.0, 2018.1.2, 2018.1.3, 2018.1.4, 2018.1.5, 2018.1.6, 2018.1.7, 2018.1.8,

2018.1.9, 2018.2.0, 2018.2.1, 2018.2.2, 2018.2.3, 2018.2.4, 2018.2.5, 2018.2.6,

2018.2.7, 2018.2.8, 2018.2.9, 2018.2.10, 2018.2.11,2018.2.12, 2018.2.13,

2018.2.14, 2018.2.15, 2018.2.16, 2018.2.17, 2018.2.18, 2018.2.19, 2018.2.20,

2018.2.21, 2018.3.0, 2018.3.1, 2018.3.2, 2018.3.3, 2018.3.4, 2018.3.5, 2018.3.6,

2018.3.7, 2018.3.8, 2018.3.9, 2018.3.10, 2018.3.11,2018.3.12, 2018.3.13,

2018.3.14, 2018.4.0, 2018.4.1, 2018.4.2, 2018.4.3, 2018.4.4, 2018.4.5, 2018.4.6,

2018.4.7, 2018.4.8, 2018.4.9

2019.1.0, 2019.1.1, 2019.1.2, 2019.1.3, 2019.1.4, 2019.1.5, 2019.1.6, 2019.1.7,

2019.1.8, 2019.1.9, 2019.1.10, 2019.1.11, 2019.2.0, 2019.2.1, 2019.2.2,

2019.2.3, 2019.2.4, 2019.2.5, 2019.2.6, 2019.2.7, 2019.2.8