Problem
When manage_build triggers a player build while the open scene has unsaved changes, Unity shows a modal Save modified scenes? dialog. Because MCP runs headlessly/automated, the build hangs until a user dismisses the dialog manually.
Expected behavior
manage_build should save assets and open scenes automatically before calling BuildPipeline.BuildPlayer, so automated builds are not blocked by save prompts.
Steps to reproduce
- Open a scene in the Unity Editor and make a change without saving.
- Call
manage_build with action=build.
- Observe Unity prompts to save modified scenes and the build does not proceed until the dialog is handled.
Proposed fix
Call AssetDatabase.SaveAssets() and EditorSceneManager.SaveOpenScenes() in BuildRunner immediately before BuildPipeline.BuildPlayer runs (same pattern already used by TestRunnerService for test runs).
Environment
- Unity MCP
manage_build tool
- Any Unity version where
BuildPipeline.BuildPlayer prompts for unsaved scenes
Problem
When
manage_buildtriggers a player build while the open scene has unsaved changes, Unity shows a modal Save modified scenes? dialog. Because MCP runs headlessly/automated, the build hangs until a user dismisses the dialog manually.Expected behavior
manage_buildshould save assets and open scenes automatically before callingBuildPipeline.BuildPlayer, so automated builds are not blocked by save prompts.Steps to reproduce
manage_buildwithaction=build.Proposed fix
Call
AssetDatabase.SaveAssets()andEditorSceneManager.SaveOpenScenes()inBuildRunnerimmediately beforeBuildPipeline.BuildPlayerruns (same pattern already used byTestRunnerServicefor test runs).Environment
manage_buildtoolBuildPipeline.BuildPlayerprompts for unsaved scenes