Main entry point.
()
| 444 | |
| 445 | |
| 446 | def main(): |
| 447 | """Main entry point.""" |
| 448 | args = parse_args() |
| 449 | |
| 450 | # Handle --list-apps (no system check needed) |
| 451 | if args.list_apps: |
| 452 | print("Supported iOS apps:") |
| 453 | print("\nNote: For iOS apps, Bundle IDs are configured in:") |
| 454 | print(" phone_agent/config/apps_ios.py") |
| 455 | print("\nCurrently configured apps:") |
| 456 | for app in sorted(list_supported_apps()): |
| 457 | print(f" - {app}") |
| 458 | print( |
| 459 | "\nTo add iOS apps, find the Bundle ID and add to APP_PACKAGES_IOS dictionary." |
| 460 | ) |
| 461 | return |
| 462 | |
| 463 | # Handle device commands (these may need partial system checks) |
| 464 | if handle_device_commands(args): |
| 465 | return |
| 466 | |
| 467 | # Run system requirements check before proceeding |
| 468 | if not check_system_requirements(wda_url=args.wda_url): |
| 469 | sys.exit(1) |
| 470 | |
| 471 | # Check model API connectivity and model availability |
| 472 | # if not check_model_api(args.base_url, args.api_key, args.model): |
| 473 | # sys.exit(1) |
| 474 | |
| 475 | # Create configurations |
| 476 | model_config = ModelConfig( |
| 477 | base_url=args.base_url, |
| 478 | model_name=args.model, |
| 479 | api_key=args.api_key |
| 480 | ) |
| 481 | |
| 482 | agent_config = IOSAgentConfig( |
| 483 | max_steps=args.max_steps, |
| 484 | wda_url=args.wda_url, |
| 485 | device_id=args.device_id, |
| 486 | verbose=not args.quiet, |
| 487 | lang=args.lang, |
| 488 | ) |
| 489 | |
| 490 | # Create iOS agent |
| 491 | agent = IOSPhoneAgent( |
| 492 | model_config=model_config, |
| 493 | agent_config=agent_config, |
| 494 | ) |
| 495 | |
| 496 | # Print header |
| 497 | print("=" * 50) |
| 498 | print("Phone Agent iOS - AI-powered iOS automation") |
| 499 | print("=" * 50) |
| 500 | print(f"Model: {model_config.model_name}") |
| 501 | print(f"Base URL: {model_config.base_url}") |
| 502 | print(f"WDA URL: {args.wda_url}") |
| 503 | print(f"Max Steps: {agent_config.max_steps}") |
no test coverage detected