Skip to content

Commit f1952dd

Browse files
authored
Merge pull request #681 from AutomationSolutionz/network-logging
2 parents 629e8b5 + ea306e8 commit f1952dd

1 file changed

Lines changed: 23 additions & 16 deletions

File tree

node_cli.py

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -980,12 +980,13 @@ async def delete_old_automationlog_folders():
980980
await asyncio.sleep(60 * 60 * 5)
981981

982982

983-
async def command_line_args() -> Path | None:
983+
async def command_line_args() -> tuple[Path | None, bool]:
984984
"""
985985
This function handles command line arguments for configuring and running Zeuz Node.
986986
987987
Returns:
988988
`log_dir` - Path object for custom log directory if specified, otherwise None
989+
`disable_mobile_install` - True if startup mobile install should be skipped
989990
990991
Example 1 - Basic usage:
991992
python node_cli.py
@@ -1150,6 +1151,11 @@ async def command_line_args() -> Path | None:
11501151
action="store_true",
11511152
help="Install Linux desktop automation dependencies (runs Installer/setup_linux_inspector.sh)",
11521153
)
1154+
parser_object.add_argument(
1155+
"--disable-mobile-install",
1156+
action="store_true",
1157+
help="Skip Node.js/Appium setup at startup",
1158+
)
11531159

11541160
all_arguments = parser_object.parse_args()
11551161

@@ -1178,6 +1184,7 @@ async def command_line_args() -> Path | None:
11781184

11791185
# Desktop automation and UI inspection options
11801186
install_linux_deps = all_arguments.install_linux_deps
1187+
disable_mobile_install = all_arguments.disable_mobile_install
11811188

11821189
# Handle RSA key management commands
11831190
if generate_key:
@@ -1284,7 +1291,7 @@ async def command_line_args() -> Path | None:
12841291
# CommonUtil.ExecLog("\ncommand_line_args : node_cli.py","Did not parse anything from given arguments",4)
12851292
# sys.exit()
12861293

1287-
return log_dir
1294+
return log_dir, disable_mobile_install
12881295

12891296

12901297
async def set_new_credentials(server, api_key):
@@ -1340,29 +1347,29 @@ async def main():
13401347
kill_old_process(Path.cwd().parent / "pid.txt")
13411348
check_min_python_version(min_python_version="3.11", show_warning=True)
13421349

1343-
# Setup Node.js and Appium before other operations
1344-
setup_nodejs_appium()
1345-
update_java_path()
1346-
1347-
update_android_sdk_path()
1348-
update_outdated_modules()
1349-
asyncio.create_task(start_server())
1350-
start_ui_dump_uploads()
1351-
asyncio.create_task(delete_old_automationlog_folders())
1352-
await destroy_session()
1353-
13541350
signal.signal(signal.SIGINT, signal_handler)
13551351
print("Press Ctrl-C or Ctrl-Break to disconnect and quit.")
13561352

1357-
console = Console()
1358-
13591353
try:
1360-
log_dir = await command_line_args()
1354+
log_dir, disable_mobile_install = await command_line_args()
13611355
except Exception as e:
13621356
print(Fore.RED + str(e))
13631357
print("Exiting...")
13641358
os._exit(1)
13651359

1360+
if not disable_mobile_install:
1361+
setup_nodejs_appium()
1362+
update_java_path()
1363+
update_android_sdk_path()
1364+
update_outdated_modules()
1365+
1366+
asyncio.create_task(start_server())
1367+
start_ui_dump_uploads()
1368+
asyncio.create_task(delete_old_automationlog_folders())
1369+
await destroy_session()
1370+
1371+
console = Console()
1372+
13661373
server_name = (
13671374
ConfigModule.get_config_value(AUTHENTICATION_TAG, "server_address")
13681375
.strip('"')

0 commit comments

Comments
 (0)