Summary
An external agent (Codex) reported that Nexus Unity "failed and could not switch the platform from PC to Android." This is a genuine tool-coverage gap, not a bug in an existing feature.
Root cause
- Nexus Unity only reports the active build target, it never sets it.
get_editor_state exposes platform as a read-only field.
- There is no RPC method anywhere in the codebase that calls
EditorUserBuildSettings.SwitchActiveBuildTarget / BuildPipeline.SwitchActiveBuildTarget (confirmed via full-repo grep, zero matches).
- The only generic escape hatch is
execute_menu_item, a thin wrapper over EditorApplication.ExecuteMenuItem.
- Editor/MCPServerMethods.Editor.cs:192-197
ExecuteMenuItem only works for items registered as top-level [MenuItem] commands. It can open the Build Settings window (File/Build Settings...), but it cannot click the "Switch Platform" button inside that window, because that button is a control inside a custom EditorWindow, not an addressable menu command.
Impact
Any agent asked to change target platform will either silently no-op (menu item executes but does nothing useful) or report failure, because there is currently no supported path to do this via the bridge at all.
Notes for the fix (not doing it now)
- Add a dedicated RPC (e.g.
set_build_target / switch_platform) that calls EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup, BuildTarget) directly.
- Platform switches are slow/blocking (asset reimport) and can't complete synchronously within a single request/response cycle — the RPC will need an async/polling pattern (e.g. kick off the switch, then let the caller poll
is_compiling/a dedicated status field) rather than blocking the HTTP handler.
Summary
An external agent (Codex) reported that Nexus Unity "failed and could not switch the platform from PC to Android." This is a genuine tool-coverage gap, not a bug in an existing feature.
Root cause
get_editor_stateexposesplatformas a read-only field.EditorUserBuildSettings.SwitchActiveBuildTarget/BuildPipeline.SwitchActiveBuildTarget(confirmed via full-repo grep, zero matches).execute_menu_item, a thin wrapper overEditorApplication.ExecuteMenuItem.ExecuteMenuItemonly works for items registered as top-level[MenuItem]commands. It can open the Build Settings window (File/Build Settings...), but it cannot click the "Switch Platform" button inside that window, because that button is a control inside a customEditorWindow, not an addressable menu command.Impact
Any agent asked to change target platform will either silently no-op (menu item executes but does nothing useful) or report failure, because there is currently no supported path to do this via the bridge at all.
Notes for the fix (not doing it now)
set_build_target/switch_platform) that callsEditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup, BuildTarget)directly.is_compiling/a dedicated status field) rather than blocking the HTTP handler.