uloop-compile

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

uloop compile

uloop compile

Execute Unity project compilation.
执行Unity项目编译。

Usage

用法

bash
uloop compile [--force-recompile] [--wait-for-domain-reload]
bash
uloop compile [--force-recompile] [--wait-for-domain-reload]

Parameters

参数

ParameterTypeDescription
--force-recompile
booleanForce full recompilation (triggers Domain Reload)
--wait-for-domain-reload
booleanWait until Domain Reload completes before returning
参数类型描述
--force-recompile
布尔值强制完全重新编译(触发Domain Reload)
--wait-for-domain-reload
布尔值等待Domain Reload完成后再返回

Global Options

全局选项

OptionDescription
--project-path <path>
Target a specific Unity project (mutually exclusive with
--port
). Path resolution follows the same rules as
cd
— absolute paths are used as-is, relative paths are resolved from cwd.
-p, --port <port>
Specify Unity TCP port directly (mutually exclusive with
--project-path
).
选项描述
--project-path <path>
指定目标Unity项目(与
--port
互斥)。路径解析遵循
cd
的相同规则——绝对路径直接使用,相对路径从当前工作目录解析。
-p, --port <port>
直接指定Unity TCP端口(与
--project-path
互斥)。

Examples

示例

bash
undefined
bash
undefined

Check compilation

检查编译情况

uloop compile
uloop compile

Force full recompilation

强制完全重新编译

uloop compile --force-recompile
uloop compile --force-recompile

Force recompilation and wait for Domain Reload completion

强制重新编译并等待Domain Reload完成

uloop compile --force-recompile true --wait-for-domain-reload true
uloop compile --force-recompile true --wait-for-domain-reload true

Wait for Domain Reload completion even without force recompilation

即使不强制重新编译,也等待Domain Reload完成

uloop compile --force-recompile false --wait-for-domain-reload true
undefined
uloop compile --force-recompile false --wait-for-domain-reload true
undefined

Output

输出

Returns JSON:
  • Success
    : boolean
  • ErrorCount
    : number
  • WarningCount
    : number
返回JSON格式数据:
  • Success
    : 布尔值
  • ErrorCount
    : 数值
  • WarningCount
    : 数值

Troubleshooting

故障排除

If CLI hangs or shows "Unity is busy" errors after compilation, stale lock files may be preventing connection. Run the following to clean them up:
bash
uloop fix
This removes any leftover lock files (
compiling.lock
,
domainreload.lock
,
serverstarting.lock
) from the Unity project's Temp directory.
如果CLI在编译后挂起或显示“Unity正忙”错误,可能是陈旧的锁定文件阻止了连接。运行以下命令清理:
bash
uloop fix
此命令会删除Unity项目Temp目录中残留的锁定文件(
compiling.lock
domainreload.lock
serverstarting.lock
)。