Version: Unity 6.3 LTS (6000.3)
Language : English
Platform Browser window reference
Create a scripts-only build

Create a clean build

By default, Unity creates builds incrementally, however the incremental pipeline can cause caching issues, or incomplete builds. For example, Unity serializes scenesA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary
and assets for the target platform during the build process, and either reuses all content from the previous build, or rebuilds everything. However, this detection might fail when global settings affect build output. You can create a clean build to resolve this issue.

When Unity creates a clean build, it discards some cached build data but reuses previously imported assets and cached shadersA program that runs on the GPU. More info
See in Glossary
to rebuild all content and code. Use a clean build when preparing release builds or troubleshooting issues caused by corrupted or outdated build caches.

To create a clean build:

  1. Open the Build Profiles window (File > Build Profiles).
  2. Next to the Build button, select the drop-down.
  3. Select Clean Build.

You can also create a clean build from a build script by passing BuildOptions.CleanBuildCache in the call to BuildPipeline.BuildPlayer.

If you don’t want Unity to reuse imported assets and cached shaders, you can delete the Library folder to force Unity to repeat all imports and shader compilation. This approach increases build time but helps avoid issues that might occur at earlier stages of the build process.

To create a clean build without using cached shaders and assets:

  1. Close the Editor.
  2. Delete the Library folder
  3. Use the previous instructions to create a clean build.

Additional resources

Platform Browser window reference
Create a scripts-only build
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961