diff --git a/loopx/cli_commands/support_control_upgrade.py b/loopx/cli_commands/support_control_upgrade.py index 0f09fee0a7..3b18cf07d8 100644 --- a/loopx/cli_commands/support_control_upgrade.py +++ b/loopx/cli_commands/support_control_upgrade.py @@ -167,7 +167,9 @@ def _restart_app( capture_output=True, timeout=min(timeout_seconds, 30), ) - launch = ["/usr/bin/open", "-a", str(app)] + # A running QA/copy can share the bundle id. LaunchServices must start + # this installation after quit, rather than activate that other process. + launch = ["/usr/bin/open", "-n", "-a", str(app)] if os.environ.get("LOOPX_BIN"): launch += ["--env", f"LOOPX_BIN={os.environ['LOOPX_BIN']}"] subprocess.run( diff --git a/tests/test_self_upgrade.py b/tests/test_self_upgrade.py index 2a9b5bf003..318120ea3d 100644 --- a/tests/test_self_upgrade.py +++ b/tests/test_self_upgrade.py @@ -37,6 +37,7 @@ def test_app_restart_keeps_an_explicit_terminal_runtime_pin(monkeypatch): _restart_app(Path("/synthetic/LoopX.app"), "a" * 32, "main", 60) quit_command = run.call_args_list[0].args[0] launch_command = run.call_args_list[1].args[0] + assert launch_command[:4] == ["/usr/bin/open", "-n", "-a", "/synthetic/LoopX.app"] assert quit_command[-1] == "/synthetic/LoopX.app" assert "/synthetic/LoopX.app" not in quit_command[2] assert (