Skip to content

Commit 538e637

Browse files
flag for skipping mobile installation
1 parent 74e6b9a commit 538e637

1 file changed

Lines changed: 18 additions & 11 deletions

File tree

node_cli.py

Lines changed: 18 additions & 11 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):
@@ -1343,8 +1350,15 @@ async def main():
13431350
signal.signal(signal.SIGINT, signal_handler)
13441351
print("Press Ctrl-C or Ctrl-Break to disconnect and quit.")
13451352

1346-
# Setup Node.js and Appium before other operations
1347-
setup_nodejs_appium()
1353+
try:
1354+
log_dir, disable_mobile_install = await command_line_args()
1355+
except Exception as e:
1356+
print(Fore.RED + str(e))
1357+
print("Exiting...")
1358+
os._exit(1)
1359+
1360+
if not disable_mobile_install:
1361+
setup_nodejs_appium()
13481362
update_java_path()
13491363

13501364
update_android_sdk_path()
@@ -1356,13 +1370,6 @@ async def main():
13561370

13571371
console = Console()
13581372

1359-
try:
1360-
log_dir = await command_line_args()
1361-
except Exception as e:
1362-
print(Fore.RED + str(e))
1363-
print("Exiting...")
1364-
os._exit(1)
1365-
13661373
server_name = (
13671374
ConfigModule.get_config_value(AUTHENTICATION_TAG, "server_address")
13681375
.strip('"')

0 commit comments

Comments
 (0)