From 74e6b9acd0c0a67d1460ee806fe1b8a5cd85d51f Mon Sep 17 00:00:00 2001 From: test Date: Mon, 30 Mar 2026 14:06:30 +0600 Subject: [PATCH 1/3] signal handler position moved upward --- node_cli.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node_cli.py b/node_cli.py index 65fdcd85..f6383634 100755 --- a/node_cli.py +++ b/node_cli.py @@ -1340,6 +1340,9 @@ async def main(): kill_old_process(Path.cwd().parent / "pid.txt") check_min_python_version(min_python_version="3.11", show_warning=True) + signal.signal(signal.SIGINT, signal_handler) + print("Press Ctrl-C or Ctrl-Break to disconnect and quit.") + # Setup Node.js and Appium before other operations setup_nodejs_appium() update_java_path() @@ -1351,9 +1354,6 @@ async def main(): asyncio.create_task(delete_old_automationlog_folders()) await destroy_session() - signal.signal(signal.SIGINT, signal_handler) - print("Press Ctrl-C or Ctrl-Break to disconnect and quit.") - console = Console() try: From 538e637018571645089cd26f0d18ad9bb5b38da4 Mon Sep 17 00:00:00 2001 From: test Date: Mon, 30 Mar 2026 14:36:33 +0600 Subject: [PATCH 2/3] flag for skipping mobile installation --- node_cli.py | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/node_cli.py b/node_cli.py index f6383634..d1985044 100755 --- a/node_cli.py +++ b/node_cli.py @@ -980,12 +980,13 @@ async def delete_old_automationlog_folders(): await asyncio.sleep(60 * 60 * 5) -async def command_line_args() -> Path | None: +async def command_line_args() -> tuple[Path | None, bool]: """ This function handles command line arguments for configuring and running Zeuz Node. Returns: `log_dir` - Path object for custom log directory if specified, otherwise None + `disable_mobile_install` - True if startup mobile install should be skipped Example 1 - Basic usage: python node_cli.py @@ -1150,6 +1151,11 @@ async def command_line_args() -> Path | None: action="store_true", help="Install Linux desktop automation dependencies (runs Installer/setup_linux_inspector.sh)", ) + parser_object.add_argument( + "--disable-mobile-install", + action="store_true", + help="Skip Node.js/Appium setup at startup", + ) all_arguments = parser_object.parse_args() @@ -1178,6 +1184,7 @@ async def command_line_args() -> Path | None: # Desktop automation and UI inspection options install_linux_deps = all_arguments.install_linux_deps + disable_mobile_install = all_arguments.disable_mobile_install # Handle RSA key management commands if generate_key: @@ -1284,7 +1291,7 @@ async def command_line_args() -> Path | None: # CommonUtil.ExecLog("\ncommand_line_args : node_cli.py","Did not parse anything from given arguments",4) # sys.exit() - return log_dir + return log_dir, disable_mobile_install async def set_new_credentials(server, api_key): @@ -1343,8 +1350,15 @@ async def main(): signal.signal(signal.SIGINT, signal_handler) print("Press Ctrl-C or Ctrl-Break to disconnect and quit.") - # Setup Node.js and Appium before other operations - setup_nodejs_appium() + try: + log_dir, disable_mobile_install = await command_line_args() + except Exception as e: + print(Fore.RED + str(e)) + print("Exiting...") + os._exit(1) + + if not disable_mobile_install: + setup_nodejs_appium() update_java_path() update_android_sdk_path() @@ -1356,13 +1370,6 @@ async def main(): console = Console() - try: - log_dir = await command_line_args() - except Exception as e: - print(Fore.RED + str(e)) - print("Exiting...") - os._exit(1) - server_name = ( ConfigModule.get_config_value(AUTHENTICATION_TAG, "server_address") .strip('"') From ea306e8220d035bf6ab798d692a1097927468f73 Mon Sep 17 00:00:00 2001 From: test Date: Mon, 30 Mar 2026 14:41:54 +0600 Subject: [PATCH 3/3] re: flag for skipping mobile installation --- node_cli.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node_cli.py b/node_cli.py index d1985044..0fc89e6e 100755 --- a/node_cli.py +++ b/node_cli.py @@ -1359,10 +1359,10 @@ async def main(): if not disable_mobile_install: setup_nodejs_appium() - update_java_path() + update_java_path() + update_android_sdk_path() + update_outdated_modules() - update_android_sdk_path() - update_outdated_modules() asyncio.create_task(start_server()) start_ui_dump_uploads() asyncio.create_task(delete_old_automationlog_folders())